[StGit PATCH 13/15] Remove "stg add"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



git-add does the exact same job, so there's no need to have it in
StGit.

Signed-off-by: Karl Hasselström <kha@xxxxxxxxxxx>

---

 Documentation/tutorial.txt    |    4 ++--
 stgit/commands/add.py         |   43 -----------------------------------------
 stgit/main.py                 |    1 -
 t/t0002-status.sh             |    2 +-
 t/t1200-push-modified.sh      |    2 +-
 t/t1202-push-undo.sh          |    4 ++--
 t/t1203-push-conflict.sh      |    4 ++--
 t/t1300-uncommit.sh           |    4 ++--
 t/t1301-assimilate.sh         |    2 +-
 t/t1400-patch-history.sh      |    4 ++--
 t/t1500-float.sh              |   14 +++++++------
 t/t1600-delete-one.sh         |   12 ++++++-----
 t/t1601-delete-many.sh        |    2 +-
 t/t1700-goto-top.sh           |    2 +-
 t/t2000-sync.sh               |    8 ++++----
 t/t2100-pull-policy-fetch.sh  |    6 +++---
 t/t2101-pull-policy-pull.sh   |    4 ++--
 t/t2102-pull-policy-rebase.sh |    6 +++---
 18 files changed, 40 insertions(+), 84 deletions(-)


diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
index 2b8e4e7..43b6409 100644
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -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
index fc9c5a7..0000000
--- a/stgit/commands/add.py
+++ /dev/null
@@ -1,43 +0,0 @@
-
-__copyright__ = """
-Copyright (C) 2005, Catalin Marinas <catalin.marinas@xxxxxxxxx>
-
-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."""
-
-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)
diff --git a/stgit/main.py b/stgit/main.py
index 5b9d7c4..c4f70ec 100644
--- a/stgit/main.py
+++ b/stgit/main.py
@@ -58,7 +58,6 @@ class Commands(dict):
         return getattr(stgit.commands, cmd_mod)
 
 commands = Commands({
-    'add':              'add',
     'applied':          'applied',
     'assimilate':       'assimilate',
     'branch':           'branch',
diff --git a/t/t0002-status.sh b/t/t0002-status.sh
index 7e34020..6a5791e 100755
--- a/t/t0002-status.sh
+++ b/t/t0002-status.sh
@@ -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
 '
diff --git a/t/t1200-push-modified.sh b/t/t1200-push-modified.sh
index 0e408d0..67e9e65 100755
--- a/t/t1200-push-modified.sh
+++ b/t/t1200-push-modified.sh
@@ -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" ] &&
diff --git a/t/t1202-push-undo.sh b/t/t1202-push-undo.sh
index 335b554..a74cfb1 100755
--- a/t/t1202-push-undo.sh
+++ b/t/t1202-push-undo.sh
@@ -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
 	'
 
diff --git a/t/t1203-push-conflict.sh b/t/t1203-push-conflict.sh
index afa52b2..afc5426 100755
--- a/t/t1203-push-conflict.sh
+++ b/t/t1203-push-conflict.sh
@@ -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
 	'
 
diff --git a/t/t1300-uncommit.sh b/t/t1300-uncommit.sh
index 2e7ff21..85408fd 100755
--- a/t/t1300-uncommit.sh
+++ b/t/t1300-uncommit.sh
@@ -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
 	'
 
diff --git a/t/t1301-assimilate.sh b/t/t1301-assimilate.sh
index 906f5bb..efe6ec4 100755
--- a/t/t1301-assimilate.sh
+++ b/t/t1301-assimilate.sh
@@ -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
     '
 
diff --git a/t/t1400-patch-history.sh b/t/t1400-patch-history.sh
index b0602ff..fcd776d 100755
--- a/t/t1400-patch-history.sh
+++ b/t/t1400-patch-history.sh
@@ -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    "
 	'
diff --git a/t/t1500-float.sh b/t/t1500-float.sh
index 814c9bd..778fde4 100755
--- a/t/t1500-float.sh
+++ b/t/t1500-float.sh
@@ -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"
 	'
diff --git a/t/t1600-delete-one.sh b/t/t1600-delete-one.sh
index df03d79..3052b3a 100755
--- a/t/t1600-delete-one.sh
+++ b/t/t1600-delete-one.sh
@@ -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
     '
 
diff --git a/t/t1601-delete-many.sh b/t/t1601-delete-many.sh
index 8eff308..30b0a1d 100755
--- a/t/t1601-delete-many.sh
+++ b/t/t1601-delete-many.sh
@@ -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 &&
diff --git a/t/t1700-goto-top.sh b/t/t1700-goto-top.sh
index 618ebc7..8f2d44a 100755
--- a/t/t1700-goto-top.sh
+++ b/t/t1700-goto-top.sh
@@ -19,7 +19,7 @@ test_expect_success \
 	'
 	stg new foo -m "Foo Patch" &&
 	echo foo > test &&
-	stg add test &&
+	git add test &&
 	stg refresh
 	'
 
diff --git a/t/t2000-sync.sh b/t/t2000-sync.sh
index f831df7..5adf818 100755
--- a/t/t2000-sync.sh
+++ b/t/t2000-sync.sh
@@ -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 &&
diff --git a/t/t2100-pull-policy-fetch.sh b/t/t2100-pull-policy-fetch.sh
index e1398a3..2c052d9 100755
--- a/t/t2100-pull-policy-fetch.sh
+++ b/t/t2100-pull-policy-fetch.sh
@@ -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
     '
@@ -61,7 +61,7 @@ test_expect_success \
     'New upstream commit and commit a patch in clone' \
     '
     (cd upstream && stg new u2 -m u2 &&
-     echo a > file3 && stg add file3 && stg refresh) &&
+     echo a > file3 && git add file3 && stg refresh) &&
     (cd clone && stg commit && stg new c2 -m c2 &&
      echo a >> file && stg refresh)
     '
diff --git a/t/t2101-pull-policy-pull.sh b/t/t2101-pull-policy-pull.sh
index 14d5adb..b4521f0 100755
--- a/t/t2101-pull-policy-pull.sh
+++ b/t/t2101-pull-policy-pull.sh
@@ -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
     '
diff --git a/t/t2102-pull-policy-rebase.sh b/t/t2102-pull-policy-rebase.sh
index 670673d..f1333d9 100755
--- a/t/t2102-pull-policy-rebase.sh
+++ b/t/t2102-pull-policy-rebase.sh
@@ -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
     '
@@ -42,7 +42,7 @@ test_expect_success \
     'New commit in parent and commit a patch in stack' \
     '
     stg branch parent && stg new u2 -m u2 &&
-     echo c > file3 && stg add file3 && stg refresh &&
+     echo c > file3 && git add file3 && stg refresh &&
     stg branch stack && stg commit && stg new c2 -m c2 &&
      echo a >> file && stg refresh
     '

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux