Remove "stg add"
authorKarl Hasselström <kha@treskal.com>
Wed, 19 Dec 2007 18:00:13 +0000 (18:00 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 19 Dec 2007 23:13:31 +0000 (23:13 +0000)
git-add does the exact same job, so there's no need to have it in
StGit.

Signed-off-by: Karl Hasselström <kha@treskal.com>
21 files changed:
Documentation/tutorial.txt
stgit/commands/add.py [deleted file]
stgit/main.py
t/t0002-status.sh
t/t1200-push-modified.sh
t/t1202-push-undo.sh
t/t1203-push-conflict.sh
t/t1204-pop-keep.sh
t/t1205-push-subdir.sh
t/t1300-uncommit.sh
t/t1301-repair.sh
t/t1400-patch-history.sh
t/t1500-float.sh
t/t1600-delete-one.sh
t/t1601-delete-many.sh
t/t1700-goto-top.sh
t/t2000-sync.sh
t/t2100-pull-policy-fetch.sh
t/t2101-pull-policy-pull.sh
t/t2102-pull-policy-rebase.sh
t/t2300-refresh-subdir.sh

index 2b8e4e7..43b6409 100644 (file)
@@ -127,14 +127,14 @@ already exist in the working directory, but you have to tell StGIT
 explicitly if you add, remove, or rename files.
 To record the addition or deletion of files in your new patch:
 
-  stg add [<file>*]
+  git add [<file>*]
   stg rm [<file>*]
 
 To record the renaming of a file in your new patch, issue both of these
 commands:
 
   stg rm <oldfilename>
-  stg add <newfilename>
+  git add <newfilename>
 
 
 Stack manipulation: managing multiple patches
diff --git a/stgit/commands/add.py b/stgit/commands/add.py
deleted file mode 100644 (file)
index ceea188..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-
-__copyright__ = """
-Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com>
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License version 2 as
-published by the Free Software Foundation.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""
-
-import sys, os
-from optparse import OptionParser, make_option
-
-from stgit.commands.common import *
-from stgit.utils import *
-from stgit import stack, git
-
-
-help = 'add files or directories to the repository'
-usage = """%prog [options] <files/dirs...>
-
-Add the files or directories passed as arguments to the
-repository. When a directory name is given, all the files and
-subdirectories are recursively added."""
-
-directory = DirectoryHasRepository(needs_current_series = False)
-options = []
-
-
-def func(parser, options, args):
-    """Add files or directories to the repository
-    """
-    if len(args) < 1:
-        parser.error('incorrect number of arguments')
-
-    git.add(args)
index 95e25f8..7f8f0c9 100644 (file)
@@ -59,7 +59,6 @@ class Commands(dict):
         return getattr(stgit.commands, cmd_mod)
 
 commands = Commands({
-    'add':              'add',
     'applied':          'applied',
     'branch':           'branch',
     'delete':           'delete',
@@ -147,7 +146,6 @@ patchcommands = (
     'sync',
     )
 wccommands = (
-    'add',
     'cp',
     'diff',
     'resolved',
index 9a5a285..9b4e60d 100755 (executable)
@@ -54,7 +54,7 @@ cat > expected.txt <<EOF
 A foo/bar
 EOF
 test_expect_success 'Status with an added file' '
-    stg add foo &&
+    git add foo &&
     stg status > output.txt &&
     diff -u expected.txt output.txt
 '
@@ -95,7 +95,7 @@ test_expect_success 'Status after refresh' '
 
 test_expect_success 'Add another file' '
     echo lajbans > fie &&
-    stg add fie &&
+    git add fie &&
     stg refresh
 '
 
@@ -166,7 +166,7 @@ EOF
 test_expect_success 'Status of disappeared newborn' '
     stg refresh &&
     touch foo/bar &&
-    stg add foo/bar &&
+    git add foo/bar &&
     rm foo/bar &&
     stg status > output.txt &&
     diff -u expected.txt output.txt
index cfec696..ba4f70c 100755 (executable)
@@ -23,7 +23,7 @@ test_expect_success \
     stg clone foo bar &&
     (
         cd bar && stg new p1 -m p1 &&
-        printf "a\nc\n" > file && stg add file && stg refresh &&
+        printf "a\nc\n" > file && git add file && stg refresh &&
         stg new p2 -m p2 &&
         printf "a\nb\nc\n" > file && stg refresh &&
         [ "$(echo $(stg applied))" = "p1 p2" ] &&
index edfa710..b602643 100755 (executable)
@@ -21,7 +21,7 @@ test_expect_success \
        '
        stg new foo -m foo &&
        echo foo > test &&
-       stg add test &&
+       git add test &&
        stg refresh
        '
 
@@ -30,7 +30,7 @@ test_expect_success \
        '
        stg new bar -m bar &&
        echo bar > test &&
-       stg add test &&
+       git add test &&
        stg refresh
        '
 
@@ -62,7 +62,7 @@ test_expect_success \
        'Undo with disappeared newborn' \
        '
        touch newfile &&
-       stg add newfile &&
+       git add newfile &&
        rm newfile &&
        stg push --undo
        '
index 57119ab..72bd49f 100755 (executable)
@@ -21,7 +21,7 @@ test_expect_success \
        stg new foo -m foo &&
        echo foo > test &&
        echo fie > test2 &&
-       stg add test test2 &&
+       git add test test2 &&
        stg refresh &&
         stg pop
        '
@@ -31,7 +31,7 @@ test_expect_success \
        '
        stg new bar -m bar &&
        echo bar > test &&
-       stg add test &&
+       git add test &&
        stg refresh
        '
 
index 40cd2a2..35f4ec0 100755 (executable)
@@ -8,7 +8,7 @@ test_expect_success 'Create a few patches' '
     for i in 0 1 2; do
         stg new p$i -m p$i &&
         echo "patch$i" >> patch$i.txt &&
-        stg add patch$i.txt &&
+        git add patch$i.txt &&
         stg refresh
     done &&
     [ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
index 54a5b89..175d36d 100755 (executable)
@@ -9,7 +9,7 @@ test_expect_success 'Create some patches' '
         stg new p$i -m p$i &&
         echo x$i >> x.txt &&
         echo y$i >> foo/y.txt &&
-        stg add x.txt foo/y.txt &&
+        git add x.txt foo/y.txt &&
         stg refresh
     done &&
     [ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
@@ -33,7 +33,7 @@ test_expect_success 'Modifying push from a subdir' '
     [ "$(echo $(cat foo/y.txt))" = "y0 y1" ] &&
     stg new extra -m extra &&
     echo extra >> extra.txt &&
-    stg add extra.txt &&
+    git add extra.txt &&
     stg refresh &&
     cd foo &&
     stg push &&
@@ -57,7 +57,7 @@ test_expect_success 'Conflicting add/unknown file in subdir' '
     stg new foo -m foo &&
     mkdir d &&
     echo foo > d/test &&
-    stg add d/test &&
+    git add d/test &&
     stg refresh &&
     stg pop &&
     mkdir -p d &&
index 2e7ff21..85408fd 100755 (executable)
@@ -19,7 +19,7 @@ test_expect_success \
        '
        stg new foo -m "Foo Patch" &&
        echo foo > test &&
-       stg add test &&
+       git add test &&
        stg refresh
        '
 
@@ -28,7 +28,7 @@ test_expect_success \
        '
        stg new bar -m "Bar Patch" &&
        echo bar > test &&
-       stg add test &&
+       git add test &&
        stg refresh
        '
 
index 5d9bdbd..b555b93 100755 (executable)
@@ -20,7 +20,7 @@ test_expect_success \
     '
     stg new foo -m foo &&
     echo foo > foo.txt &&
-    stg add foo.txt &&
+    git add foo.txt &&
     stg refresh
     '
 
index 5b842d0..879b1a5 100755 (executable)
@@ -20,7 +20,7 @@ test_expect_success \
        '
        stg new foo -m "Foo Patch" &&
        echo foo > test && echo foo2 >> test &&
-       stg add test &&
+       git add test &&
        stg refresh --annotate="foo notes"
        '
 
@@ -55,7 +55,7 @@ test_expect_success \
        'Check the "push" log' \
        '
        stg pop &&
-       echo foo > test2 && stg add test2 && stg refresh &&
+       echo foo > test2 && git add test2 && stg refresh &&
        stg push &&
        stg log --full | grep -q -e "^push    "
        '
index 814c9bd..778fde4 100755 (executable)
@@ -12,13 +12,13 @@ test_description='Test floating a number of patches to the top of the stack
 test_expect_success \
        'Initialize the StGIT repository' \
        'stg init &&
-        stg new A -m "a" && echo A >a.txt && stg add a.txt && stg refresh &&
-        stg new B -m "b" && echo B >b.txt && stg add b.txt && stg refresh &&
-        stg new C -m "c" && echo C >c.txt && stg add c.txt && stg refresh &&
-        stg new D -m "d" && echo D >d.txt && stg add d.txt && stg refresh &&
-        stg new E -m "e" && echo E >e.txt && stg add e.txt && stg refresh &&
-        stg new F -m "f" && echo F >f.txt && stg add f.txt && stg refresh &&
-        stg new G -m "g" && echo G >g.txt && stg add g.txt && stg refresh &&
+        stg new A -m "a" && echo A >a.txt && git add a.txt && stg refresh &&
+        stg new B -m "b" && echo B >b.txt && git add b.txt && stg refresh &&
+        stg new C -m "c" && echo C >c.txt && git add c.txt && stg refresh &&
+        stg new D -m "d" && echo D >d.txt && git add d.txt && stg refresh &&
+        stg new E -m "e" && echo E >e.txt && git add e.txt && stg refresh &&
+        stg new F -m "f" && echo F >f.txt && git add f.txt && stg refresh &&
+        stg new G -m "g" && echo G >g.txt && git add g.txt && stg refresh &&
         stg pop &&
         test "$(echo $(stg applied))" = "A B C D E F"
        '
index df03d79..3052b3a 100755 (executable)
@@ -12,7 +12,7 @@ test_expect_success \
     '
     stg new foo -m foo &&
     echo foo > foo.txt &&
-    stg add foo.txt &&
+    git add foo.txt &&
     stg refresh
     '
 
@@ -47,7 +47,7 @@ test_expect_success \
     '
     stg new foo -m foo &&
     echo foo > foo.txt &&
-    stg add foo.txt &&
+    git add foo.txt &&
     stg refresh &&
     stg pop
     '
@@ -65,11 +65,11 @@ test_expect_success \
     '
     stg new foo -m foo &&
     echo foo > foo.txt &&
-    stg add foo.txt &&
+    git add foo.txt &&
     stg refresh &&
     stg new bar -m bar &&
     echo bar > bar.txt &&
-    stg add bar.txt &&
+    git add bar.txt &&
     stg refresh
     '
 
@@ -87,12 +87,12 @@ test_expect_success \
     stg branch --create br &&
     stg new baz -m baz &&
     echo baz > baz.txt &&
-    stg add baz.txt &&
+    git add baz.txt &&
     stg refresh &&
     stg branch master &&
     stg new baz -m baz &&
     echo baz > baz.txt &&
-    stg add baz.txt &&
+    git add baz.txt &&
     stg refresh
     '
 
index 8eff308..30b0a1d 100755 (executable)
@@ -12,7 +12,7 @@ test_expect_success \
     '
     stg new p0 -m p0 &&
     echo p0 > foo.txt &&
-    stg add foo.txt &&
+    git add foo.txt &&
     stg refresh &&
     for i in 1 2 3 4 5 6 7 8 9; do
         stg new p$i -m p$i &&
index 618ebc7..8f2d44a 100755 (executable)
@@ -19,7 +19,7 @@ test_expect_success \
        '
        stg new foo -m "Foo Patch" &&
        echo foo > test &&
-       stg add test &&
+       git add test &&
        stg refresh
        '
 
index 484dbab..e489603 100755 (executable)
@@ -18,15 +18,15 @@ test_expect_success \
     '
     stg new p1 -m p1 &&
     echo foo1 > foo1.txt &&
-    stg add foo1.txt &&
+    git add foo1.txt &&
     stg refresh &&
     stg new p2 -m p2 &&
     echo foo2 > foo2.txt &&
-    stg add foo2.txt &&
+    git add foo2.txt &&
     stg refresh &&
     stg new p3 -m p3 &&
     echo foo3 > foo3.txt &&
-    stg add foo3.txt &&
+    git add foo3.txt &&
     stg refresh &&
     stg export &&
     stg pop &&
@@ -86,7 +86,7 @@ test_expect_success \
     stg refresh &&
     stg goto p2 &&
     echo bar2 > bar2.txt &&
-    stg add bar2.txt &&
+    git add bar2.txt &&
     stg refresh &&
     stg goto p3 &&
     echo bar3 >> foo3.txt &&
index 28901b1..9e4bc31 100755 (executable)
@@ -22,7 +22,7 @@ test_expect_success \
      git repo-config branch.master.stgit.pull-policy fetch-rebase &&
      git repo-config --list &&
      stg new c1 -m c1 &&
-     echo a > file && stg add file && stg refresh
+     echo a > file && git add file && stg refresh
     )
     '
 
@@ -30,7 +30,7 @@ test_expect_success \
     'Add non-rewinding commit upstream and pull it from clone' \
     '
     (cd upstream && stg new u1 -m u1 &&
-     echo a > file2 && stg add file2 && stg refresh) &&
+     echo a > file2 && git add file2 && stg refresh) &&
     (cd clone && stg pull) &&
     test -e clone/file2
     '
index 14d5adb..b4521f0 100755 (executable)
@@ -22,7 +22,7 @@ test_expect_success \
      git repo-config branch.master.stgit.pull-policy pull &&
      git repo-config --list &&
      stg new c1 -m c1 &&
-     echo a > file && stg add file && stg refresh
+     echo a > file && git add file && stg refresh
     )
     '
 
@@ -30,7 +30,7 @@ test_expect_success \
     'Add non-rewinding commit upstream and pull it from clone' \
     '
     (cd upstream && stg new u1 -m u1 &&
-     echo a > file2 && stg add file2 && stg refresh) &&
+     echo a > file2 && git add file2 && stg refresh) &&
     (cd clone && stg pull) &&
      test -e clone/file2
     '
index ce2e32f..135b48c 100755 (executable)
@@ -16,14 +16,14 @@ test_expect_success \
     git repo-config branch.stack.stgit.pull-policy rebase &&
     git repo-config --list &&
     stg new c1 -m c1 &&
-    echo a > file && stg add file && stg refresh
+    echo a > file && git add file && stg refresh
     '
 
 test_expect_success \
     'Add non-rewinding commit in parent and pull the stack' \
     '
     stg branch parent && stg new u1 -m u1 &&
-    echo b > file2 && stg add file2 && stg refresh &&
+    echo b > file2 && git add file2 && stg refresh &&
     stg branch stack && stg pull &&
     test -e file2
     '
index 750e429..92c1cc8 100755 (executable)
@@ -8,7 +8,7 @@ test_expect_success 'Refresh from a subdirectory' '
     echo foo >> foo.txt &&
     mkdir bar &&
     echo bar >> bar/bar.txt &&
-    stg add foo.txt bar/bar.txt &&
+    git add foo.txt bar/bar.txt &&
     cd bar &&
     stg refresh &&
     cd .. &&