chiark / gitweb /
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 2b8e4e782aa827de3be31f43af312ab2a03401d8..43b6409fac2ea987fa6ab695eb79a16c2c932686 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 95e25f8795648d33052b2607ebb73d79ec7999a6..7f8f0c9c74815eb0f79905c5489cda8da7293cc1 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 9a5a285cf46771c963f0667ad12aad6d4bea40ab..9b4e60d70646c3f57697572ca9822fd6586a0333 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 cfec6960a29fba3793fdd1d57f2923893bfcab2c..ba4f70c43714979f287064d6d6581493ef8f1964 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 edfa7105e2fced7b2491ebf11288e3b756c09459..b602643f9018509bc605de1199afe47bd178453e 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 57119ab0718915dcc05024b55ba4c3cd9924287f..72bd49fe45b58f73f692891a54f6097614ab3754 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 40cd2a2aa33bc16f6fb3f010a47d3352c80effd3..35f4ec0b094fc6406df9b759676d892a73383e92 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 54a5b896e199d8529e99fe994d30d5ee266e63f0..175d36d2888987b85505de8810183217e63b3ba2 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 2e7ff211745d413bb2fee81080407444202fbea0..85408fdce8e8759219b5a44efca0598dac7b1327 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 5d9bdbdc4b8e408eb997a9d2f38fd65302ede1f7..b555b93ac11c38393d68de68a3bea142394bde43 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 5b842d0b116246398a29d4766d4185c3ed98a63c..879b1a5a03bceb66d9d97b31f24bcbc5b313de49 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 814c9bd2981f3099345c920f7dc4fba00205f355..778fde47570a4c4da7c41250e5d3608bc4fb47be 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 df03d79c860db85377e3bac80eab8c1aca83f6ab..3052b3a9426b994ec236a4a912083c0214ed175b 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 8eff308ebfa7e7477096522ac041b42a24df27f1..30b0a1dd0a33defbe04a31aeb3550aaaedc8434c 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 618ebc7cfc7b15b6b647481cbee10da89035731b..8f2d44a0eb526dcec31559cd61791dce45f26828 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 484dbabb75702d2c38ca0b73e84c0a1f3d9930a4..e489603f3fa4d7d64c31cd52e17f8fd193242911 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 28901b1d819b35be0647c33da162d8fd01b00826..9e4bc31612deaeebb2572bed9ed2a51711f5c88a 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 14d5adb7a378d484df5d577d09d7e9dd06d3c309..b4521f0cd37a298c91f1271b4516dfe10f4b5199 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 ce2e32f91b1a18cf6b533b12ac9094966144b0c3..135b48cf6d5e326e39b80d52de25bb94b04be6fb 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 750e4291bb675662eed035c6b7e73557783792f8..92c1cc86577b12f6ff77f955fe6ae3874765757c 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 .. &&