{"thread":{"id":"22129","subject":"[StGit PATCH 0/3] Support for command aliases","startedAt":"2010-01-08T12:35:53Z","lastAt":"2010-01-08T14:34:25Z","messageCount":6,"participants":["Catalin Marinas","Karl Wiberg"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"131079","messageId":"20100108123403.24161.3495.stgit@pc1117.cambridge.arm.com","threadId":"22129","inReplyTo":null,"subject":"[StGit PATCH 0/3] Support for command aliases","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@arm.com","sentAt":"2010-01-08T12:35:53Z","receivedAt":"2010-01-08T12:35:53Z","isPatch":true,"sender":{"key":"catalin.marinas@arm.com","avatar":null},"body":"Hi,\n\nThese patches add support for StGit command aliases via\nstgit.alias.<cmd> config options. They also re-add previously removed\ncommands (add, rm, resolved) and a new one (mv).\n\nstg help lists the present aliases.\n\n\nCatalin Marinas (3):\n      Populate the cached config options with the defaults\n      Add support for command aliases\n      Replace some git commands with stg aliases in test scripts\n\n\n stgit/commands/__init__.py     |    3 ++-\n stgit/config.py                |   37 +++++++++++++++++++++++--------------\n stgit/main.py                  |   35 ++++++++++++++++++++++++++++++++++-\n t/t0001-subdir-branches.sh     |    2 +-\n t/t0002-status.sh              |   12 ++++++------\n t/t1000-branch-create.sh       |    4 ++--\n t/t1002-branch-clone.sh        |    2 +-\n t/t1200-push-modified.sh       |    2 +-\n t/t1201-pull-trailing.sh       |    2 +-\n t/t1202-push-undo.sh           |    6 +++---\n t/t1203-push-conflict.sh       |    6 +++---\n t/t1204-pop-keep.sh            |    2 +-\n t/t1205-push-subdir.sh         |    6 +++---\n t/t1206-push-hidden.sh         |    2 +-\n t/t1207-push-tree.sh           |    2 +-\n t/t1300-uncommit.sh            |    4 ++--\n t/t1301-repair.sh              |    8 ++++----\n t/t1302-repair-interop.sh      |    2 +-\n t/t1500-float.sh               |   14 +++++++-------\n t/t1501-sink.sh                |   12 ++++++------\n t/t1600-delete-one.sh          |   12 ++++++------\n t/t1601-delete-many.sh         |    2 +-\n t/t1602-delete-spill.sh        |    2 +-\n t/t1700-goto-top.sh            |    2 +-\n t/t1701-goto-hidden.sh         |    2 +-\n t/t1800-import.sh              |    4 ++--\n t/t1900-mail.sh                |    2 +-\n t/t2000-sync.sh                |   12 ++++++------\n t/t2100-pull-policy-fetch.sh   |    4 ++--\n t/t2101-pull-policy-pull.sh    |    6 +++---\n t/t2102-pull-policy-rebase.sh  |    4 ++--\n t/t2200-rebase.sh              |    4 ++--\n t/t2300-refresh-subdir.sh      |    4 ++--\n t/t2400-diff.sh                |    2 +-\n t/t2500-clean.sh               |    2 +-\n t/t2600-squash.sh              |    2 +-\n t/t2700-refresh.sh             |    6 +++---\n t/t2701-refresh-p.sh           |    4 ++--\n t/t2702-refresh-rm.sh          |   10 +++++-----\n t/t2800-goto-subdir.sh         |    2 +-\n t/t3000-dirty-merge.sh         |    2 +-\n t/t3100-reset.sh               |    2 +-\n t/t3101-reset-hard.sh          |    2 +-\n t/t3102-undo.sh                |    2 +-\n t/t3103-undo-hard.sh           |    2 +-\n t/t3104-redo.sh                |    2 +-\n t/t3105-undo-external-mod.sh   |    6 +++---\n t/t3200-non-ascii-filenames.sh |    4 ++--\n t/t3300-edit.sh                |    2 +-\n t/t3400-pick.sh                |    8 ++++----\n t/t4100-publish.sh             |   12 ++++++------\n 51 files changed, 169 insertions(+), 126 deletions(-)\n\n-- \nCatalin\n"},{"id":"131080","messageId":"20100108123559.24161.14842.stgit@pc1117.cambridge.arm.com","threadId":"22129","inReplyTo":"20100108123403.24161.3495.stgit@pc1117.cambridge.arm.com","subject":"[StGit PATCH 1/3] Populate the cached config options with the defaults","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@arm.com","sentAt":"2010-01-08T12:35:59Z","receivedAt":"2010-01-08T12:35:59Z","isPatch":true,"sender":{"key":"catalin.marinas@arm.com","avatar":null},"body":"The patch pre-populates the cached config options with the default\nvalues. It also removes an unused option (stgit.extensions).\n\nSigned-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n---\n stgit/config.py |   28 ++++++++++++++--------------\n 1 files changed, 14 insertions(+), 14 deletions(-)\n\ndiff --git a/stgit/config.py b/stgit/config.py\nindex 796f2c9..811138d 100644\n--- a/stgit/config.py\n+++ b/stgit/config.py\n@@ -28,16 +28,15 @@ class GitConfigException(StgException):\n \n class GitConfig:\n     __defaults={\n-        'stgit.smtpserver':\t'localhost:25',\n-        'stgit.smtpdelay':\t'5',\n-        'stgit.pullcmd':\t'git pull',\n-        'stgit.fetchcmd':\t'git fetch',\n-        'stgit.pull-policy':\t'pull',\n-        'stgit.autoimerge':\t'no',\n-        'stgit.keepoptimized':\t'no',\n-        'stgit.extensions':\t'.ancestor .current .patched',\n-        'stgit.shortnr': '5',\n-        'stgit.pager':  'less'\n+        'stgit.smtpserver':     ['localhost:25'],\n+        'stgit.smtpdelay':      ['5'],\n+        'stgit.pullcmd':        ['git pull'],\n+        'stgit.fetchcmd':       ['git fetch'],\n+        'stgit.pull-policy':    ['pull'],\n+        'stgit.autoimerge':     ['no'],\n+        'stgit.keepoptimized':  ['no'],\n+        'stgit.shortnr':        ['5'],\n+        'stgit.pager':          ['less']\n         }\n \n     __cache = None\n@@ -47,7 +46,7 @@ class GitConfig:\n         done already.\"\"\"\n         if self.__cache is not None:\n             return\n-        self.__cache = {}\n+        self.__cache = self.__defaults\n         lines = Run('git', 'config', '--null', '--list'\n                    ).discard_exitcode().raw_output()\n         for line in filter(None, lines.split('\\0')):\n@@ -56,9 +55,10 @@ class GitConfig:\n \n     def get(self, name):\n         self.load()\n-        if name not in self.__cache:\n-            self.__cache[name] = [self.__defaults.get(name, None)]\n-        return self.__cache[name][-1]\n+        try:\n+            return self.__cache[name][-1]\n+        except KeyError:\n+            return None\n \n     def getall(self, name):\n         self.load()\n"},{"id":"131081","messageId":"20100108123604.24161.25653.stgit@pc1117.cambridge.arm.com","threadId":"22129","inReplyTo":"20100108123403.24161.3495.stgit@pc1117.cambridge.arm.com","subject":"[StGit PATCH 2/3] Add support for command aliases","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@arm.com","sentAt":"2010-01-08T12:36:04Z","receivedAt":"2010-01-08T12:36:04Z","isPatch":true,"sender":{"key":"catalin.marinas@arm.com","avatar":null},"body":"This patch introduces support StGit command aliases with a few defaults:\n\nstg add\t\t-> git add\nstg rm\t\t-> git rm\nstg mv\t\t-> git mv\nstg resolved\t-> git add\n\nSigned-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n---\n stgit/commands/__init__.py |    3 ++-\n stgit/config.py            |   11 ++++++++++-\n stgit/main.py              |   35 ++++++++++++++++++++++++++++++++++-\n 3 files changed, 46 insertions(+), 3 deletions(-)\n\ndiff --git a/stgit/commands/__init__.py b/stgit/commands/__init__.py\nindex f6cf3c3..f9de42b 100644\n--- a/stgit/commands/__init__.py\n+++ b/stgit/commands/__init__.py\n@@ -28,7 +28,8 @@ def get_command(mod):\n _kinds = [('repo', 'Repository commands'),\n           ('stack', 'Stack (branch) commands'),\n           ('patch', 'Patch commands'),\n-          ('wc', 'Index/worktree commands')]\n+          ('wc', 'Index/worktree commands'),\n+          ('alias', 'Alias commands')]\n _kind_order = [kind for kind, desc in _kinds]\n _kinds = dict(_kinds)\n \ndiff --git a/stgit/config.py b/stgit/config.py\nindex 811138d..dd194d3 100644\n--- a/stgit/config.py\n+++ b/stgit/config.py\n@@ -36,7 +36,11 @@ class GitConfig:\n         'stgit.autoimerge':     ['no'],\n         'stgit.keepoptimized':  ['no'],\n         'stgit.shortnr':        ['5'],\n-        'stgit.pager':          ['less']\n+        'stgit.pager':          ['less'],\n+        'stgit.alias.add':      ['git add'],\n+        'stgit.alias.rm':       ['git rm'],\n+        'stgit.alias.mv':       ['git mv'],\n+        'stgit.alias.resolved': ['git add']\n         }\n \n     __cache = None\n@@ -76,6 +80,11 @@ class GitConfig:\n         else:\n             raise GitConfigException, 'Value for \"%s\" is not an integer: \"%s\"' % (name, value)\n \n+    def getstartswith(self, name):\n+        self.load()\n+        return ((n, v[-1]) for (n, v) in self.__cache.iteritems()\n+                if n.startswith(name))\n+\n     def rename_section(self, from_name, to_name):\n         \"\"\"Rename a section in the config file. Silently do nothing if\n         the section doesn't exist.\"\"\"\ndiff --git a/stgit/main.py b/stgit/main.py\nindex e324179..d5be70b 100644\n--- a/stgit/main.py\n+++ b/stgit/main.py\n@@ -23,6 +23,30 @@ import sys, os, traceback\n import stgit.commands\n from stgit.out import *\n from stgit import argparse, run, utils\n+from stgit.config import config\n+\n+class CommandAlias(object):\n+    def __init__(self, name, command):\n+        self.__command = command\n+        self.__name__ = name\n+        self.usage = ['<arguments>']\n+        self.help = 'Alias for \"%s <arguments>\".' % self.__command\n+        self.options = []\n+\n+    def func(self, args):\n+        cmd = self.__command.split() + args\n+        p = run.Run(*cmd)\n+        p.discard_exitcode().run()\n+        return p.exitcode\n+\n+def is_cmd_alias(cmd):\n+    return isinstance(cmd, CommandAlias)\n+\n+def append_alias_commands(cmd_list):\n+    for (name, command) in config.getstartswith('stgit.alias.'):\n+        name = utils.strip_prefix('stgit.alias.', name)\n+        cmd_list[name] = (CommandAlias(name, command),\n+                          'Alias commands', command)\n \n #\n # The commands map\n@@ -49,9 +73,13 @@ class Commands(dict):\n         \n     def __getitem__(self, key):\n         cmd_mod = self.get(key) or self.get(self.canonical_cmd(key))\n-        return stgit.commands.get_command(cmd_mod)\n+        if is_cmd_alias(cmd_mod):\n+            return cmd_mod\n+        else:\n+            return stgit.commands.get_command(cmd_mod)\n \n cmd_list = stgit.commands.get_commands()\n+append_alias_commands(cmd_list)\n commands = Commands((cmd, mod) for cmd, (mod, kind, help)\n                     in cmd_list.iteritems())\n \n@@ -100,6 +128,8 @@ def _main():\n             sys.argv[0] += ' %s' % cmd\n             command = commands[cmd]\n             parser = argparse.make_option_parser(command)\n+            if is_cmd_alias(command):\n+                parser.remove_option('-h')\n             from pydoc import pager\n             pager(parser.format_help())\n         else:\n@@ -121,6 +151,9 @@ def _main():\n     del(sys.argv[1])\n \n     command = commands[cmd]\n+    if is_cmd_alias(command):\n+        sys.exit(command.func(sys.argv[1:]))\n+\n     parser = argparse.make_option_parser(command)\n     options, args = parser.parse_args()\n     directory = command.directory\n"},{"id":"131082","messageId":"20100108123610.24161.56597.stgit@pc1117.cambridge.arm.com","threadId":"22129","inReplyTo":"20100108123403.24161.3495.stgit@pc1117.cambridge.arm.com","subject":"[StGit PATCH 3/3] Replace some git commands with stg aliases in test scripts","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@arm.com","sentAt":"2010-01-08T12:36:10Z","receivedAt":"2010-01-08T12:36:10Z","isPatch":true,"sender":{"key":"catalin.marinas@arm.com","avatar":null},"body":"Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n---\n t/t0001-subdir-branches.sh     |    2 +-\n t/t0002-status.sh              |   12 ++++++------\n t/t1000-branch-create.sh       |    4 ++--\n t/t1002-branch-clone.sh        |    2 +-\n t/t1200-push-modified.sh       |    2 +-\n t/t1201-pull-trailing.sh       |    2 +-\n t/t1202-push-undo.sh           |    6 +++---\n t/t1203-push-conflict.sh       |    6 +++---\n t/t1204-pop-keep.sh            |    2 +-\n t/t1205-push-subdir.sh         |    6 +++---\n t/t1206-push-hidden.sh         |    2 +-\n t/t1207-push-tree.sh           |    2 +-\n t/t1300-uncommit.sh            |    4 ++--\n t/t1301-repair.sh              |    8 ++++----\n t/t1302-repair-interop.sh      |    2 +-\n t/t1500-float.sh               |   14 +++++++-------\n t/t1501-sink.sh                |   12 ++++++------\n t/t1600-delete-one.sh          |   12 ++++++------\n t/t1601-delete-many.sh         |    2 +-\n t/t1602-delete-spill.sh        |    2 +-\n t/t1700-goto-top.sh            |    2 +-\n t/t1701-goto-hidden.sh         |    2 +-\n t/t1800-import.sh              |    4 ++--\n t/t1900-mail.sh                |    2 +-\n t/t2000-sync.sh                |   12 ++++++------\n t/t2100-pull-policy-fetch.sh   |    4 ++--\n t/t2101-pull-policy-pull.sh    |    6 +++---\n t/t2102-pull-policy-rebase.sh  |    4 ++--\n t/t2200-rebase.sh              |    4 ++--\n t/t2300-refresh-subdir.sh      |    4 ++--\n t/t2400-diff.sh                |    2 +-\n t/t2500-clean.sh               |    2 +-\n t/t2600-squash.sh              |    2 +-\n t/t2700-refresh.sh             |    6 +++---\n t/t2701-refresh-p.sh           |    4 ++--\n t/t2702-refresh-rm.sh          |   10 +++++-----\n t/t2800-goto-subdir.sh         |    2 +-\n t/t3000-dirty-merge.sh         |    2 +-\n t/t3100-reset.sh               |    2 +-\n t/t3101-reset-hard.sh          |    2 +-\n t/t3102-undo.sh                |    2 +-\n t/t3103-undo-hard.sh           |    2 +-\n t/t3104-redo.sh                |    2 +-\n t/t3105-undo-external-mod.sh   |    6 +++---\n t/t3200-non-ascii-filenames.sh |    4 ++--\n t/t3300-edit.sh                |    2 +-\n t/t3400-pick.sh                |    8 ++++----\n t/t4100-publish.sh             |   12 ++++++------\n 48 files changed, 110 insertions(+), 110 deletions(-)\n\ndiff --git a/t/t0001-subdir-branches.sh b/t/t0001-subdir-branches.sh\nindex 3f7962a..5ea787e 100755\n--- a/t/t0001-subdir-branches.sh\n+++ b/t/t0001-subdir-branches.sh\n@@ -14,7 +14,7 @@ containing slashes (that is, branches living in a subdirectory of\n test_expect_success 'Create a patch' \\\n   'stg init &&\n    echo \"foo\" > foo.txt &&\n-   git add foo.txt &&\n+   stg add foo.txt &&\n    stg new foo -m \"Add foo.txt\" &&\n    stg refresh'\n \ndiff --git a/t/t0002-status.sh b/t/t0002-status.sh\nindex 2512c53..c978845 100755\n--- a/t/t0002-status.sh\n+++ b/t/t0002-status.sh\n@@ -54,7 +54,7 @@ cat > expected.txt <<EOF\n A foo/bar\n EOF\n test_expect_success 'Status with an added file' '\n-    git add foo &&\n+    stg add foo &&\n     stg status > output.txt &&\n     test_cmp expected.txt output.txt\n '\n@@ -95,7 +95,7 @@ test_expect_success 'Status after refresh' '\n \n test_expect_success 'Add another file' '\n     echo lajbans > fie &&\n-    git add fie &&\n+    stg add fie &&\n     stg refresh\n '\n \n@@ -145,7 +145,7 @@ A fie\n M foo/bar\n EOF\n test_expect_success 'Status after resolving the push' '\n-    git add --update &&\n+    stg add --update &&\n     stg status > output.txt &&\n     test_cmp expected.txt output.txt\n '\n@@ -166,7 +166,7 @@ EOF\n test_expect_success 'Status of disappeared newborn' '\n     stg refresh &&\n     touch foo/bar &&\n-    git add foo/bar &&\n+    stg add foo/bar &&\n     rm foo/bar &&\n     stg status > output.txt &&\n     test_cmp expected.txt output.txt\n@@ -177,8 +177,8 @@ A fay\n D fie\n EOF\n test_expect_success 'Status after renaming a file' '\n-    git rm foo/bar &&\n-    git mv fie fay &&\n+    stg rm foo/bar &&\n+    stg mv fie fay &&\n     stg status > output.txt &&\n     test_cmp expected.txt output.txt\n '\ndiff --git a/t/t1000-branch-create.sh b/t/t1000-branch-create.sh\nindex 3fff3ee..2626c73 100755\n--- a/t/t1000-branch-create.sh\n+++ b/t/t1000-branch-create.sh\n@@ -78,9 +78,9 @@ test_expect_success \\\n     'Setup two commits including removal of generated files' '\n     git init &&\n     touch file1 file2 &&\n-    git add file1 file2 &&\n+    stg add file1 file2 &&\n     git commit -m 1 &&\n-    git rm file1 file2 &&\n+    stg rm file1 file2 &&\n     git commit -m 2 &&\n     touch file2\n '\ndiff --git a/t/t1002-branch-clone.sh b/t/t1002-branch-clone.sh\nindex 1303b41..4930c20 100755\n--- a/t/t1002-branch-clone.sh\n+++ b/t/t1002-branch-clone.sh\n@@ -14,7 +14,7 @@ test_expect_success \\\n     'Create a GIT commit' \\\n     '\n     echo bar > bar.txt &&\n-    git add bar.txt &&\n+    stg add bar.txt &&\n     git commit -a -m bar\n     '\n \ndiff --git a/t/t1200-push-modified.sh b/t/t1200-push-modified.sh\nindex 2077492..e04dac5 100755\n--- a/t/t1200-push-modified.sh\n+++ b/t/t1200-push-modified.sh\n@@ -23,7 +23,7 @@ test_expect_success \\\n     stg clone foo bar &&\n     (\n         cd bar && stg new p1 -m p1 &&\n-        printf \"a\\nc\\n\" > file && git add file && stg refresh &&\n+        printf \"a\\nc\\n\" > file && stg add file && stg refresh &&\n         stg new p2 -m p2 &&\n         printf \"a\\nb\\nc\\n\" > file && stg refresh &&\n         [ \"$(echo $(stg series --applied --noprefix))\" = \"p1 p2\" ] &&\ndiff --git a/t/t1201-pull-trailing.sh b/t/t1201-pull-trailing.sh\nindex d66ad26..a993aeb 100755\n--- a/t/t1201-pull-trailing.sh\n+++ b/t/t1201-pull-trailing.sh\n@@ -18,7 +18,7 @@ test_create_repo foo\n test_expect_success \\\n     'Setup and clone tree, and setup changes' \\\n     \"(cd foo &&\n-      printf 'a\\nb\\n' > file && git add file && git commit -m .\n+      printf 'a\\nb\\n' > file && stg add file && git commit -m .\n      ) &&\n      stg clone foo bar &&\n      (cd bar && stg new p1 -m p1\ndiff --git a/t/t1202-push-undo.sh b/t/t1202-push-undo.sh\nindex 14a3d6d..5afcf68 100755\n--- a/t/t1202-push-undo.sh\n+++ b/t/t1202-push-undo.sh\n@@ -21,7 +21,7 @@ test_expect_success \\\n \t'\n \tstg new foo -m foo &&\n \techo foo > test &&\n-\tgit add test &&\n+\tstg add test &&\n \tstg refresh\n \t'\n \n@@ -30,7 +30,7 @@ test_expect_success \\\n \t'\n \tstg new bar -m bar &&\n \techo bar > test &&\n-\tgit add test &&\n+\tstg add test &&\n \tstg refresh\n \t'\n \n@@ -62,7 +62,7 @@ test_expect_success \\\n \t'Undo with disappeared newborn' \\\n \t'\n \ttouch newfile &&\n-\tgit add newfile &&\n+\tstg add newfile &&\n \trm newfile &&\n \tstg undo --hard\n \t'\ndiff --git a/t/t1203-push-conflict.sh b/t/t1203-push-conflict.sh\nindex 8027e6c..b759298 100755\n--- a/t/t1203-push-conflict.sh\n+++ b/t/t1203-push-conflict.sh\n@@ -21,7 +21,7 @@ test_expect_success \\\n \tstg new foo -m foo &&\n \techo foo > test &&\n \techo fie > test2 &&\n-\tgit add test test2 &&\n+\tstg add test test2 &&\n \tstg refresh &&\n         stg pop\n \t'\n@@ -31,7 +31,7 @@ test_expect_success \\\n \t'\n \tstg new bar -m bar &&\n \techo bar > test &&\n-\tgit add test &&\n+\tstg add test &&\n \tstg refresh\n \t'\n \n@@ -63,7 +63,7 @@ test_expect_success \\\n \t'Resolve the conflict' \\\n \t'\n \techo resolved > test &&\n-\tgit add test &&\n+\tstg resolved test &&\n \tstg refresh\n \t'\n \ndiff --git a/t/t1204-pop-keep.sh b/t/t1204-pop-keep.sh\nindex db473f2..ee5d058 100755\n--- a/t/t1204-pop-keep.sh\n+++ b/t/t1204-pop-keep.sh\n@@ -8,7 +8,7 @@ test_expect_success 'Create a few patches' '\n     for i in 0 1 2; do\n         stg new p$i -m p$i &&\n         echo \"patch$i\" >> patch$i.txt &&\n-        git add patch$i.txt &&\n+        stg add patch$i.txt &&\n         stg refresh\n     done &&\n     [ \"$(echo $(stg series --applied --noprefix))\" = \"p0 p1 p2\" ] &&\ndiff --git a/t/t1205-push-subdir.sh b/t/t1205-push-subdir.sh\nindex 2d5918b..4af63ce 100755\n--- a/t/t1205-push-subdir.sh\n+++ b/t/t1205-push-subdir.sh\n@@ -9,7 +9,7 @@ test_expect_success 'Create some patches' '\n         stg new p$i -m p$i &&\n         echo x$i >> x.txt &&\n         echo y$i >> foo/y.txt &&\n-        git add x.txt foo/y.txt &&\n+        stg add x.txt foo/y.txt &&\n         stg refresh\n     done &&\n     [ \"$(echo $(stg series --applied --noprefix))\" = \"p0 p1 p2\" ] &&\n@@ -33,7 +33,7 @@ test_expect_success 'Modifying push from a subdir' '\n     [ \"$(echo $(cat foo/y.txt))\" = \"y0 y1\" ] &&\n     stg new extra -m extra &&\n     echo extra >> extra.txt &&\n-    git add extra.txt &&\n+    stg add extra.txt &&\n     stg refresh &&\n     cd foo &&\n     stg push &&\n@@ -57,7 +57,7 @@ test_expect_success 'Conflicting add/unknown file in subdir' '\n     stg new foo -m foo &&\n     mkdir d &&\n     echo foo > d/test &&\n-    git add d/test &&\n+    stg add d/test &&\n     stg refresh &&\n     stg pop &&\n     mkdir -p d &&\ndiff --git a/t/t1206-push-hidden.sh b/t/t1206-push-hidden.sh\nindex 20aa306..ee8e254 100755\n--- a/t/t1206-push-hidden.sh\n+++ b/t/t1206-push-hidden.sh\n@@ -7,7 +7,7 @@ test_description='Test \"stg push\" with hidden patches'\n test_expect_success 'Initialize StGit stack' '\n     stg init &&\n     echo foo > foo.txt &&\n-    git add foo.txt &&\n+    stg add foo.txt &&\n     stg new -m hidden-patch &&\n     stg refresh &&\n     stg pop &&\ndiff --git a/t/t1207-push-tree.sh b/t/t1207-push-tree.sh\nindex 9d0b1cc..e97cb1b 100755\n--- a/t/t1207-push-tree.sh\n+++ b/t/t1207-push-tree.sh\n@@ -12,7 +12,7 @@ test_expect_success \\\n     stg init &&\n     stg new A -m A &&\n     echo hello world > a &&\n-    git add a &&\n+    stg add a &&\n     stg refresh\n     stg new B -m B &&\n     echo HELLO WORLD > a &&\ndiff --git a/t/t1300-uncommit.sh b/t/t1300-uncommit.sh\nindex 43e0d04..5e9b8fb 100755\n--- a/t/t1300-uncommit.sh\n+++ b/t/t1300-uncommit.sh\n@@ -19,7 +19,7 @@ test_expect_success \\\n \t'\n \tstg new foo -m \"Foo Patch\" &&\n \techo foo > test &&\n-\tgit add test &&\n+\tstg add test &&\n \tstg refresh\n \t'\n \n@@ -28,7 +28,7 @@ test_expect_success \\\n \t'\n \tstg new bar -m \"Bar Patch\" &&\n \techo bar > test &&\n-\tgit add test &&\n+\tstg add test &&\n \tstg refresh\n \t'\n \ndiff --git a/t/t1301-repair.sh b/t/t1301-repair.sh\nindex 8d5d4e5..939699c 100755\n--- a/t/t1301-repair.sh\n+++ b/t/t1301-repair.sh\n@@ -20,7 +20,7 @@ test_expect_success \\\n     '\n     stg new foo -m foo &&\n     echo foo > foo.txt &&\n-    git add foo.txt &&\n+    stg add foo.txt &&\n     stg refresh\n     '\n \n@@ -32,7 +32,7 @@ test_expect_success \\\n     'Create a GIT commit' \\\n     '\n     echo bar > bar.txt &&\n-    git add bar.txt &&\n+    stg add bar.txt &&\n     git commit -a -m bar\n     '\n \n@@ -46,7 +46,7 @@ test_expect_success \\\n     'Create three more GIT commits' \\\n     '\n     echo one > numbers.txt &&\n-    git add numbers.txt &&\n+    stg add numbers.txt &&\n     git commit -a -m one &&\n     echo two >> numbers.txt &&\n     git commit -a -m two &&\n@@ -65,7 +65,7 @@ test_expect_success \\\n     '\n     git checkout -b br master^^ &&\n     echo woof > woof.txt &&\n-    git add woof.txt &&\n+    stg add woof.txt &&\n     git commit -a -m woof &&\n     git checkout master &&\n     git pull . br\ndiff --git a/t/t1302-repair-interop.sh b/t/t1302-repair-interop.sh\nindex 9fad3fa..cce3cf1 100755\n--- a/t/t1302-repair-interop.sh\n+++ b/t/t1302-repair-interop.sh\n@@ -4,7 +4,7 @@ test_description='Test git/StGit interoperability with \"stg repair\"'\n \n test_expect_success 'Create some git-only history' '\n     echo foo > foo.txt &&\n-    git add foo.txt &&\n+    stg add foo.txt &&\n     git commit -a -m foo &&\n     git tag foo-tag &&\n     for i in 0 1 2 3 4; do\ndiff --git a/t/t1500-float.sh b/t/t1500-float.sh\nindex e44af3a..0ed5733 100755\n--- a/t/t1500-float.sh\n+++ b/t/t1500-float.sh\n@@ -12,13 +12,13 @@ test_description='Test floating a number of patches to the top of the stack\n test_expect_success \\\n \t'Initialize the StGIT repository' \\\n \t'stg init &&\n-\t stg new A -m \"a\" && echo A >a.txt && git add a.txt && stg refresh &&\n-\t stg new B -m \"b\" && echo B >b.txt && git add b.txt && stg refresh &&\n-\t stg new C -m \"c\" && echo C >c.txt && git add c.txt && stg refresh &&\n-\t stg new D -m \"d\" && echo D >d.txt && git add d.txt && stg refresh &&\n-\t stg new E -m \"e\" && echo E >e.txt && git add e.txt && stg refresh &&\n-\t stg new F -m \"f\" && echo F >f.txt && git add f.txt && stg refresh &&\n-\t stg new G -m \"g\" && echo G >g.txt && git add g.txt && stg refresh &&\n+\t stg new A -m \"a\" && echo A >a.txt && stg add a.txt && stg refresh &&\n+\t stg new B -m \"b\" && echo B >b.txt && stg add b.txt && stg refresh &&\n+\t stg new C -m \"c\" && echo C >c.txt && stg add c.txt && stg refresh &&\n+\t stg new D -m \"d\" && echo D >d.txt && stg add d.txt && stg refresh &&\n+\t stg new E -m \"e\" && echo E >e.txt && stg add e.txt && stg refresh &&\n+\t stg new F -m \"f\" && echo F >f.txt && stg add f.txt && stg refresh &&\n+\t stg new G -m \"g\" && echo G >g.txt && stg add g.txt && stg refresh &&\n \t stg pop &&\n \t test \"$(echo $(stg series --applied --noprefix))\" = \"A B C D E F\"\n \t'\ndiff --git a/t/t1501-sink.sh b/t/t1501-sink.sh\nindex a0769dd..e2c65cb 100755\n--- a/t/t1501-sink.sh\n+++ b/t/t1501-sink.sh\n@@ -6,22 +6,22 @@ test_description='Test \"stg sink\"'\n \n test_expect_success 'Initialize StGit stack' '\n     echo 0 >> f0 &&\n-    git add f0 &&\n+    stg add f0 &&\n     git commit -m initial &&\n     echo 1 >> f1 &&\n-    git add f1 &&\n+    stg add f1 &&\n     git commit -m p1 &&\n     echo 2 >> f2 &&\n-    git add f2 &&\n+    stg add f2 &&\n     git commit -m p2 &&\n     echo 3 >> f3 &&\n-    git add f3 &&\n+    stg add f3 &&\n     git commit -m p3 &&\n     echo 4 >> f4 &&\n-    git add f4 &&\n+    stg add f4 &&\n     git commit -m p4 &&\n     echo 22 >> f2 &&\n-    git add f2 &&\n+    stg add f2 &&\n     git commit -m p22 &&\n     stg init &&\n     stg uncommit p22 p4 p3 p2 p1 &&\ndiff --git a/t/t1600-delete-one.sh b/t/t1600-delete-one.sh\nindex ef0b29d..f55bad6 100755\n--- a/t/t1600-delete-one.sh\n+++ b/t/t1600-delete-one.sh\n@@ -12,7 +12,7 @@ test_expect_success \\\n     '\n     stg new foo -m foo &&\n     echo foo > foo.txt &&\n-    git add foo.txt &&\n+    stg add foo.txt &&\n     stg refresh\n     '\n \n@@ -47,7 +47,7 @@ test_expect_success \\\n     '\n     stg new foo -m foo &&\n     echo foo > foo.txt &&\n-    git add foo.txt &&\n+    stg add foo.txt &&\n     stg refresh &&\n     stg pop\n     '\n@@ -65,11 +65,11 @@ test_expect_success \\\n     '\n     stg new foo -m foo &&\n     echo foo > foo.txt &&\n-    git add foo.txt &&\n+    stg add foo.txt &&\n     stg refresh &&\n     stg new bar -m bar &&\n     echo bar > bar.txt &&\n-    git add bar.txt &&\n+    stg add bar.txt &&\n     stg refresh\n     '\n \n@@ -87,12 +87,12 @@ test_expect_success \\\n     stg branch --create br &&\n     stg new baz -m baz &&\n     echo baz > baz.txt &&\n-    git add baz.txt &&\n+    stg add baz.txt &&\n     stg refresh &&\n     stg branch master &&\n     stg new baz -m baz &&\n     echo baz > baz.txt &&\n-    git add baz.txt &&\n+    stg add baz.txt &&\n     stg refresh\n     '\n \ndiff --git a/t/t1601-delete-many.sh b/t/t1601-delete-many.sh\nindex cb7fb0d..a0818b3 100755\n--- a/t/t1601-delete-many.sh\n+++ b/t/t1601-delete-many.sh\n@@ -12,7 +12,7 @@ test_expect_success \\\n     '\n     stg new p0 -m p0 &&\n     echo p0 > foo.txt &&\n-    git add foo.txt &&\n+    stg add foo.txt &&\n     stg refresh &&\n     for i in 1 2 3 4 5 6 7 8 9; do\n         stg new p$i -m p$i &&\ndiff --git a/t/t1602-delete-spill.sh b/t/t1602-delete-spill.sh\nindex 1ddec53..3e27598 100755\n--- a/t/t1602-delete-spill.sh\n+++ b/t/t1602-delete-spill.sh\n@@ -9,7 +9,7 @@ test_expect_success 'Initialize the StGIT repository' '\n test_expect_success 'Create five applied and three unapplied patches' '\n     for i in 0 1 2 3 4 5 6 7; do\n         echo $i >> foo &&\n-        git add foo &&\n+        stg add foo &&\n         git commit -m p$i\n     done\n     stg uncommit -n 8 &&\ndiff --git a/t/t1700-goto-top.sh b/t/t1700-goto-top.sh\nindex 8f2d44a..618ebc7 100755\n--- a/t/t1700-goto-top.sh\n+++ b/t/t1700-goto-top.sh\n@@ -19,7 +19,7 @@ test_expect_success \\\n \t'\n \tstg new foo -m \"Foo Patch\" &&\n \techo foo > test &&\n-\tgit add test &&\n+\tstg add test &&\n \tstg refresh\n \t'\n \ndiff --git a/t/t1701-goto-hidden.sh b/t/t1701-goto-hidden.sh\nindex a3c6e62..19ab703 100755\n--- a/t/t1701-goto-hidden.sh\n+++ b/t/t1701-goto-hidden.sh\n@@ -7,7 +7,7 @@ test_description='Test \"stg goto\" with hidden patches'\n test_expect_success 'Initialize StGit stack' '\n     stg init &&\n     echo foo > foo.txt &&\n-    git add foo.txt &&\n+    stg add foo.txt &&\n     stg new -m hidden-patch &&\n     stg refresh &&\n     stg pop &&\ndiff --git a/t/t1800-import.sh b/t/t1800-import.sh\nindex 93de794..406a6cf 100755\n--- a/t/t1800-import.sh\n+++ b/t/t1800-import.sh\n@@ -7,7 +7,7 @@ test_expect_success \\\n     'Initialize the StGIT repository' \\\n     '\n     cp ../t1800-import/foo.txt . &&\n-    git add foo.txt &&\n+    stg add foo.txt &&\n     git commit -a -m \"initial version\" &&\n     stg init\n     '\n@@ -164,7 +164,7 @@ test_expect_success \\\n     'apply a series from a tarball' \\\n     '\n     rm -f jabberwocky.txt && touch jabberwocky.txt &&\n-    git add jabberwocky.txt && git commit -m \"empty file\" jabberwocky.txt &&\n+    stg add jabberwocky.txt && git commit -m \"empty file\" jabberwocky.txt &&\n     (cd ../t1800-import; tar -cjf jabberwocky.tar.bz2 patches) &&\n     stg import --series ../t1800-import/jabberwocky.tar.bz2\n     [ $(git cat-file -p $(stg id) \\\ndiff --git a/t/t1900-mail.sh b/t/t1900-mail.sh\nindex cea6769..acb61a7 100755\n--- a/t/t1900-mail.sh\n+++ b/t/t1900-mail.sh\n@@ -10,7 +10,7 @@ test_expect_success \\\n     for i in 1 2 3 4 5; do\n       touch foo.txt &&\n       echo \"line $i\" >> foo.txt &&\n-      git add foo.txt &&\n+      stg add foo.txt &&\n       git commit -a -m \"Patch $i\"\n     done &&\n     stg init &&\ndiff --git a/t/t2000-sync.sh b/t/t2000-sync.sh\nindex d550538..696d698 100755\n--- a/t/t2000-sync.sh\n+++ b/t/t2000-sync.sh\n@@ -18,15 +18,15 @@ test_expect_success \\\n     '\n     stg new p1 -m p1 &&\n     echo foo1 > foo1.txt &&\n-    git add foo1.txt &&\n+    stg add foo1.txt &&\n     stg refresh &&\n     stg new p2 -m p2 &&\n     echo foo2 > foo2.txt &&\n-    git add foo2.txt &&\n+    stg add foo2.txt &&\n     stg refresh &&\n     stg new p3 -m p3 &&\n     echo foo3 > foo3.txt &&\n-    git add foo3.txt &&\n+    stg add foo3.txt &&\n     stg refresh &&\n     stg export &&\n     stg pop &&\n@@ -86,7 +86,7 @@ test_expect_success \\\n     stg refresh &&\n     stg goto p2 &&\n     echo bar2 > bar2.txt &&\n-    git add bar2.txt &&\n+    stg add bar2.txt &&\n     stg refresh &&\n     stg goto p3 &&\n     echo bar3 >> foo3.txt &&\n@@ -117,7 +117,7 @@ test_expect_success \\\n     '\n     [ \"$(echo $(stg series --applied --noprefix))\" = \"p1\" ] &&\n     [ \"$(echo $(stg series --unapplied --noprefix))\" = \"p2 p3\" ] &&\n-    git add --update &&\n+    stg add --update &&\n     stg refresh &&\n     stg goto p3\n     [ \"$(echo $(stg series --applied --noprefix))\" = \"p1 p2 p3\" ] &&\n@@ -135,7 +135,7 @@ test_expect_success \\\n     '\n     [ \"$(echo $(stg series --applied --noprefix))\" = \"p1 p2 p3\" ] &&\n     [ \"$(echo $(stg series --unapplied --noprefix))\" = \"\" ] &&\n-    git add --update &&\n+    stg add --update &&\n     stg refresh &&\n     [ \"$(echo $(stg series --applied --noprefix))\" = \"p1 p2 p3\" ] &&\n     [ \"$(echo $(stg series --unapplied --noprefix))\" = \"\" ]\ndiff --git a/t/t2100-pull-policy-fetch.sh b/t/t2100-pull-policy-fetch.sh\nindex 670c7c6..07435f5 100755\n--- a/t/t2100-pull-policy-fetch.sh\n+++ b/t/t2100-pull-policy-fetch.sh\n@@ -22,7 +22,7 @@ test_expect_success \\\n      git config branch.master.stgit.pull-policy fetch-rebase &&\n      git config --list &&\n      stg new c1 -m c1 &&\n-     echo a > file && git add file && stg refresh\n+     echo a > file && stg add file && stg refresh\n     )\n     '\n \n@@ -30,7 +30,7 @@ test_expect_success \\\n     'Add non-rewinding commit upstream and pull it from clone' \\\n     '\n     (cd upstream && stg new u1 -m u1 &&\n-     echo a > file2 && git add file2 && stg refresh) &&\n+     echo a > file2 && stg add file2 && stg refresh) &&\n     (cd clone && stg pull) &&\n     test -e clone/file2\n     '\ndiff --git a/t/t2101-pull-policy-pull.sh b/t/t2101-pull-policy-pull.sh\nindex 777ccb5..35c15ad 100755\n--- a/t/t2101-pull-policy-pull.sh\n+++ b/t/t2101-pull-policy-pull.sh\n@@ -22,7 +22,7 @@ test_expect_success \\\n      git config branch.master.stgit.pull-policy pull &&\n      git config --list &&\n      stg new c1 -m c1 &&\n-     echo a > file && git add file && stg refresh\n+     echo a > file && stg add file && stg refresh\n     )\n     '\n \n@@ -30,7 +30,7 @@ test_expect_success \\\n     'Add non-rewinding commit upstream and pull it from clone' \\\n     '\n     (cd upstream && stg new u1 -m u1 &&\n-     echo a > file2 && git add file2 && stg refresh) &&\n+     echo a > file2 && stg add file2 && stg refresh) &&\n     (cd clone && stg pull) &&\n      test -e clone/file2\n     '\n@@ -49,7 +49,7 @@ test_expect_success \\\n test_expect_success \\\n     '\"Solve\" the conflict (pretend there is none)' \\\n     '(cd clone &&\n-      git add file2 && EDITOR=cat git commit)'\n+      stg add file2 && EDITOR=cat git commit)'\n \n test_expect_success \\\n     'Push the stack back' \\\ndiff --git a/t/t2102-pull-policy-rebase.sh b/t/t2102-pull-policy-rebase.sh\nindex 5619bda..952ee7e 100755\n--- a/t/t2102-pull-policy-rebase.sh\n+++ b/t/t2102-pull-policy-rebase.sh\n@@ -16,14 +16,14 @@ test_expect_success \\\n     git config branch.stack.stgit.pull-policy rebase &&\n     git config --list &&\n     stg new c1 -m c1 &&\n-    echo a > file && git add file && stg refresh\n+    echo a > file && stg add file && stg refresh\n     '\n \n test_expect_success \\\n     'Add non-rewinding commit in parent and pull the stack' \\\n     '\n     stg branch parent && stg new u1 -m u1 &&\n-    echo b > file2 && git add file2 && stg refresh &&\n+    echo b > file2 && stg add file2 && stg refresh &&\n     stg branch stack && stg pull &&\n     test -e file2\n     '\ndiff --git a/t/t2200-rebase.sh b/t/t2200-rebase.sh\nindex adbf242..75e1f17 100755\n--- a/t/t2200-rebase.sh\n+++ b/t/t2200-rebase.sh\n@@ -11,10 +11,10 @@ test_expect_success \\\n \t'Setup a multi-commit branch and fork an stgit stack' \\\n \t'\n \techo foo > file1 &&\n-\tgit add file1 &&\n+\tstg add file1 &&\n \tgit commit -m a &&\n \techo foo > file2 &&\n-\tgit add file2 &&\n+\tstg add file2 &&\n \tgit commit -m b &&\n \n \tstg branch --create stack &&\ndiff --git a/t/t2300-refresh-subdir.sh b/t/t2300-refresh-subdir.sh\nindex 89c95db..34d6e69 100755\n--- a/t/t2300-refresh-subdir.sh\n+++ b/t/t2300-refresh-subdir.sh\n@@ -8,7 +8,7 @@ test_expect_success 'Refresh from a subdirectory' '\n     echo foo >> foo.txt &&\n     mkdir bar &&\n     echo bar >> bar/bar.txt &&\n-    git add foo.txt bar/bar.txt &&\n+    stg add foo.txt bar/bar.txt &&\n     cd bar &&\n     stg refresh &&\n     cd .. &&\n@@ -48,7 +48,7 @@ test_expect_success 'Refresh subdirectories recursively' '\n test_expect_success 'refresh -u' '\n     echo baz >> bar/baz.txt &&\n     stg new p1 -m p1 &&\n-    git add bar/baz.txt &&\n+    stg add bar/baz.txt &&\n     stg refresh --index &&\n     echo xyzzy >> foo.txt &&\n     echo xyzzy >> bar/bar.txt &&\ndiff --git a/t/t2400-diff.sh b/t/t2400-diff.sh\nindex fbcefe1..73f4539 100755\n--- a/t/t2400-diff.sh\n+++ b/t/t2400-diff.sh\n@@ -10,7 +10,7 @@ test_expect_success 'Diff with no StGit data' '\n \n test_expect_success 'Make some local changes' '\n     echo foo >> foo.txt &&\n-    git add foo.txt\n+    stg add foo.txt\n '\n \n test_expect_success 'Diff with some local changes' '\ndiff --git a/t/t2500-clean.sh b/t/t2500-clean.sh\nindex 7f821f5..8082c21 100755\n--- a/t/t2500-clean.sh\n+++ b/t/t2500-clean.sh\n@@ -9,7 +9,7 @@ test_expect_success 'Initialize StGit stack' '\n     stg new e0 -m e0 &&\n     stg new p0 -m p0 &&\n     echo foo > foo.txt &&\n-    git add foo.txt &&\n+    stg add foo.txt &&\n     stg refresh &&\n     stg new e1 -m e1 &&\n     stg new e2 -m e2 &&\ndiff --git a/t/t2600-squash.sh b/t/t2600-squash.sh\nindex 3dba012..e36a638 100755\n--- a/t/t2600-squash.sh\n+++ b/t/t2600-squash.sh\n@@ -9,7 +9,7 @@ test_expect_success 'Initialize StGit stack' '\n     for i in 0 1 2 3; do\n         stg new p$i -m \"foo $i\" &&\n         echo \"foo $i\" >> foo.txt &&\n-        git add foo.txt &&\n+        stg add foo.txt &&\n         stg refresh\n     done\n '\ndiff --git a/t/t2700-refresh.sh b/t/t2700-refresh.sh\nindex aad6d45..6028b9e 100755\n--- a/t/t2700-refresh.sh\n+++ b/t/t2700-refresh.sh\n@@ -13,7 +13,7 @@ test_expect_success 'Initialize StGit stack' '\n     stg new p0 -m \"base\" &&\n     for i in 1 2 3; do\n         echo base >> foo$i.txt &&\n-        git add foo$i.txt\n+        stg add foo$i.txt\n     done\n     stg refresh &&\n     for i in 1 2 3; do\n@@ -104,7 +104,7 @@ test_expect_success 'Refresh --index' '\n     stg status &&\n     stg new p4 -m \"refresh_index\" &&\n     echo baz 1 >> foo1.txt &&\n-    git add foo1.txt &&\n+    stg add foo1.txt &&\n     echo blah 1 >> foo1.txt &&\n     echo baz 2 >> foo2.txt &&\n     stg refresh --index &&\n@@ -119,7 +119,7 @@ test_expect_success 'Refresh --index' '\n '\n \n test_expect_success 'Refresh moved files' '\n-    git mv foo1.txt foo1-new.txt &&\n+    stg mv foo1.txt foo1-new.txt &&\n     stg refresh\n '\n \ndiff --git a/t/t2701-refresh-p.sh b/t/t2701-refresh-p.sh\nindex ed4bac4..3ba3b02 100755\n--- a/t/t2701-refresh-p.sh\n+++ b/t/t2701-refresh-p.sh\n@@ -15,7 +15,7 @@ test_expect_success 'Initialize StGit stack' '\n     stg init &&\n     for i in 1 2; do\n         echo x > $i.txt &&\n-        git add $i.txt &&\n+        stg add $i.txt &&\n         stg new p$i -m \"Patch $i\" &&\n         stg refresh\n     done\n@@ -33,7 +33,7 @@ test_expect_success 'Add new file to non-top patch' '\n     stg status > status1.txt &&\n     test_cmp expected0.txt status1.txt &&\n     echo y > new.txt &&\n-    git add new.txt &&\n+    stg add new.txt &&\n     stg refresh -p p1 &&\n     stg status > status2.txt &&\n     test_cmp expected0.txt status2.txt &&\ndiff --git a/t/t2702-refresh-rm.sh b/t/t2702-refresh-rm.sh\nindex 0362cc6..fa81cee 100755\n--- a/t/t2702-refresh-rm.sh\n+++ b/t/t2702-refresh-rm.sh\n@@ -20,7 +20,7 @@ test_expect_success 'Initialize StGit stack' '\n     stg init &&\n     echo x > x.txt &&\n     echo y > y.txt &&\n-    git add x.txt y.txt &&\n+    stg add x.txt y.txt &&\n     git commit -m \"Add some files\"\n '\n \n@@ -28,9 +28,9 @@ cat > expected0.txt <<EOF\n D y.txt\n EOF\n printf '' > expected1.txt\n-test_expect_success 'git rm a file' '\n+test_expect_success 'stg rm a file' '\n     stg new -m p0 &&\n-    git rm y.txt &&\n+    stg rm y.txt &&\n     stg status > status0.txt &&\n     test_cmp expected0.txt status0.txt &&\n     stg refresh &&\n@@ -47,10 +47,10 @@ D y.txt\n M x.txt\n EOF\n printf '' > expected1.txt\n-test_expect_success 'git rm a file together with other changes' '\n+test_expect_success 'stg rm a file together with other changes' '\n     stg new -m p1 &&\n     echo x2 >> x.txt &&\n-    git rm y.txt &&\n+    stg rm y.txt &&\n     stg status > status0.txt &&\n     test_cmp expected0.txt status0.txt &&\n     stg refresh &&\ndiff --git a/t/t2800-goto-subdir.sh b/t/t2800-goto-subdir.sh\nindex 5960bd6..5ac77cc 100755\n--- a/t/t2800-goto-subdir.sh\n+++ b/t/t2800-goto-subdir.sh\n@@ -13,7 +13,7 @@ test_expect_success 'Initialize StGit stack' '\n     for i in 1 2 3; do\n         echo foo$i >> foo/bar &&\n         stg new p$i -m p$i &&\n-        git add foo/bar &&\n+        stg add foo/bar &&\n         stg refresh\n     done\n '\ndiff --git a/t/t3000-dirty-merge.sh b/t/t3000-dirty-merge.sh\nindex 419d86e..d8c16fa 100755\n--- a/t/t3000-dirty-merge.sh\n+++ b/t/t3000-dirty-merge.sh\n@@ -7,7 +7,7 @@ test_description='Try a push that requires merging a file that is dirty'\n test_expect_success 'Initialize StGit stack with two patches' '\n     stg init &&\n     touch a &&\n-    git add a &&\n+    stg add a &&\n     git commit -m a &&\n     echo 1 > a &&\n     git commit -a -m p1 &&\ndiff --git a/t/t3100-reset.sh b/t/t3100-reset.sh\nindex 3024975..61f303d 100755\n--- a/t/t3100-reset.sh\n+++ b/t/t3100-reset.sh\n@@ -12,7 +12,7 @@ EOF\n test_expect_success 'Initialize StGit stack with three patches' '\n     stg init &&\n     echo 000 >> a &&\n-    git add a &&\n+    stg add a &&\n     git commit -m a &&\n     echo 111 >> a &&\n     git commit -a -m p1 &&\ndiff --git a/t/t3101-reset-hard.sh b/t/t3101-reset-hard.sh\nindex 45e86dc..a93682b 100755\n--- a/t/t3101-reset-hard.sh\n+++ b/t/t3101-reset-hard.sh\n@@ -13,7 +13,7 @@ EOF\n test_expect_success 'Initialize StGit stack with three patches' '\n     stg init &&\n     echo 000 >> a &&\n-    git add a &&\n+    stg add a &&\n     git commit -m a &&\n     echo 111 >> a &&\n     git commit -a -m p1 &&\ndiff --git a/t/t3102-undo.sh b/t/t3102-undo.sh\nindex 9373522..010a63d 100755\n--- a/t/t3102-undo.sh\n+++ b/t/t3102-undo.sh\n@@ -12,7 +12,7 @@ EOF\n test_expect_success 'Initialize StGit stack with three patches' '\n     stg init &&\n     echo 000 >> a &&\n-    git add a &&\n+    stg add a &&\n     git commit -m a &&\n     echo 111 >> a &&\n     git commit -a -m p1 &&\ndiff --git a/t/t3103-undo-hard.sh b/t/t3103-undo-hard.sh\nindex df14b1f..b94543e 100755\n--- a/t/t3103-undo-hard.sh\n+++ b/t/t3103-undo-hard.sh\n@@ -13,7 +13,7 @@ EOF\n test_expect_success 'Initialize StGit stack with three patches' '\n     stg init &&\n     echo 000 >> a &&\n-    git add a &&\n+    stg add a &&\n     git commit -m a &&\n     echo 111 >> a &&\n     git commit -a -m p1 &&\ndiff --git a/t/t3104-redo.sh b/t/t3104-redo.sh\nindex 030311d..3d3c617 100755\n--- a/t/t3104-redo.sh\n+++ b/t/t3104-redo.sh\n@@ -12,7 +12,7 @@ EOF\n test_expect_success 'Initialize StGit stack with three patches' '\n     stg init &&\n     echo 000 >> a &&\n-    git add a &&\n+    stg add a &&\n     git commit -m a &&\n     echo 111 >> a &&\n     git commit -a -m p1 &&\ndiff --git a/t/t3105-undo-external-mod.sh b/t/t3105-undo-external-mod.sh\nindex f5aad64..1980167 100755\n--- a/t/t3105-undo-external-mod.sh\n+++ b/t/t3105-undo-external-mod.sh\n@@ -13,10 +13,10 @@ EOF\n test_expect_success 'Initialize StGit stack' '\n     stg init &&\n     echo 000 >> a &&\n-    git add a &&\n+    stg add a &&\n     git commit -m p0 &&\n     echo 111 >> a &&\n-    git add a &&\n+    stg add a &&\n     git commit -m p1 &&\n     stg uncommit -n 1\n '\n@@ -29,7 +29,7 @@ EOF\n test_expect_success 'Make a git commit and turn it into a patch' '\n     git rev-parse HEAD > head0.txt &&\n     echo 222 >> a &&\n-    git add a &&\n+    stg add a &&\n     git commit -m p2 &&\n     git rev-parse HEAD > head1.txt &&\n     stg repair &&\ndiff --git a/t/t3200-non-ascii-filenames.sh b/t/t3200-non-ascii-filenames.sh\nindex 1aa78ed..fe2ecc0 100755\n--- a/t/t3200-non-ascii-filenames.sh\n+++ b/t/t3200-non-ascii-filenames.sh\n@@ -11,11 +11,11 @@ EOF\n \n test_expect_success 'Setup' '\n     echo \"Fjäderholmarna\" > skärgårdsö.txt &&\n-    git add skärgårdsö.txt &&\n+    stg add skärgårdsö.txt &&\n     git commit -m \"Create island\" &&\n     stg init &&\n     echo foo > unrelated.txt &&\n-    git add unrelated.txt &&\n+    stg add unrelated.txt &&\n     stg new p0 -m \"Unrelated file\" &&\n     stg refresh &&\n     stg pop &&\ndiff --git a/t/t3300-edit.sh b/t/t3300-edit.sh\nindex ad3b23f..7003a27 100755\n--- a/t/t3300-edit.sh\n+++ b/t/t3300-edit.sh\n@@ -5,7 +5,7 @@ test_description='Test \"stg edit\"'\n \n test_expect_success 'Setup' '\n     printf \"000\\n111\\n222\\n333\\n\" >> foo &&\n-    git add foo &&\n+    stg add foo &&\n     git commit -m \"Initial commit\" &&\n     sed -i \"s/000/000xx/\" foo &&\n     git commit -a -m \"First change\" &&\ndiff --git a/t/t3400-pick.sh b/t/t3400-pick.sh\nindex 6e92de3..22b348c 100755\n--- a/t/t3400-pick.sh\n+++ b/t/t3400-pick.sh\n@@ -7,11 +7,11 @@ test_expect_success \\\n \t'Initialize the StGIT repository' \\\n \t'\n \tstg init &&\n-\tstg new A -m \"a\" && echo A > a && git add a && stg refresh &&\n-\tstg new B -m \"b\" && echo B > b && git add b && stg refresh &&\n+\tstg new A -m \"a\" && echo A > a && stg add a && stg refresh &&\n+\tstg new B -m \"b\" && echo B > b && stg add b && stg refresh &&\n \tstg branch --clone foo &&\n-\tstg new C -m \"c\" && echo C > c && git add c && stg refresh &&\n-\tstg new D-foo -m \"d\" && echo D > d && git add d && stg refresh &&\n+\tstg new C -m \"c\" && echo C > c && stg add c && stg refresh &&\n+\tstg new D-foo -m \"d\" && echo D > d && stg add d && stg refresh &&\n \tstg branch master\n \t'\n \ndiff --git a/t/t4100-publish.sh b/t/t4100-publish.sh\nindex 17e07bc..7d72a6c 100755\n--- a/t/t4100-publish.sh\n+++ b/t/t4100-publish.sh\n@@ -26,15 +26,15 @@ test_expect_success \\\n \t'\n \tstg new p1 -m p1 &&\n \techo foo1 > foo1.txt &&\n-\tgit add foo1.txt &&\n+\tstg add foo1.txt &&\n \tstg refresh &&\n \tstg new p2 -m p2 &&\n \techo foo2 > foo2.txt &&\n-\tgit add foo2.txt &&\n+\tstg add foo2.txt &&\n \tstg refresh &&\n \tstg new p3 -m p3 &&\n \techo foo3 > foo3.txt &&\n-\tgit add foo3.txt &&\n+\tstg add foo3.txt &&\n \tstg refresh\n \t'\n \n@@ -64,11 +64,11 @@ test_expect_success \\\n \t'\n \tstg new p4 -m p4 &&\n \techo foo4 > foo4.txt &&\n-\tgit add foo4.txt &&\n+\tstg add foo4.txt &&\n \tstg refresh &&\n \tstg new p5 -m p5 &&\n \techo foo5 > foo5.txt &&\n-\tgit add foo5.txt &&\n+\tstg add foo5.txt &&\n \tstg refresh &&\n \tstg new empty -m empty &&\n \told_public=$(stg id master.public) &&\n@@ -83,7 +83,7 @@ test_expect_success \\\n \t'\n \tstg pop -a &&\n \techo foo0 > foo0.txt &&\n-\tgit add foo0.txt &&\n+\tstg add foo0.txt &&\n \tgit commit -m \"foo0.txt added\" &&\n \tstg push -a &&\n \told_public=$(stg id master.public) &&\n"},{"id":"131093","messageId":"b8197bcb1001080630i6daad79anf8323f8001d38db3@mail.gmail.com","threadId":"22129","inReplyTo":"20100108123559.24161.14842.stgit@pc1117.cambridge.arm.com","subject":"Re: [StGit PATCH 1/3] Populate the cached config options with the defaults","fromName":"Karl Wiberg","fromEmail":"kha@treskal.com","sentAt":"2010-01-08T14:30:48Z","receivedAt":"2010-01-08T14:30:48Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Hmm. What's the point of this rewrite?\n\nOn Fri, Jan 8, 2010 at 1:35 PM, Catalin Marinas <catalin.marinas@arm.com> wrote:\n\n> +        try:\n> +            return self.__cache[name][-1]\n> +        except KeyError:\n> +            return None\n\nYou could write this as\n\n  return self.__cache.get(name, [None])[-1]\n\n-- \nKarl Wiberg, kha@treskal.com\n   subrabbit.wordpress.com\n   www.treskal.com/kalle\n"},{"id":"131094","messageId":"b8197bcb1001080634g5480877dhd35e0bd1cbe63ca6@mail.gmail.com","threadId":"22129","inReplyTo":"b8197bcb1001080630i6daad79anf8323f8001d38db3@mail.gmail.com","subject":"Re: [StGit PATCH 1/3] Populate the cached config options with the defaults","fromName":"Karl Wiberg","fromEmail":"kha@treskal.com","sentAt":"2010-01-08T14:34:25Z","receivedAt":"2010-01-08T14:34:25Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On Fri, Jan 8, 2010 at 3:30 PM, Karl Wiberg <kha@treskal.com> wrote:\n> Hmm. What's the point of this rewrite?\n\nAh, never mind, patch 2/3 made it clear. Though it would have been\nnice to read about it in the commit message. ;-)\n\n-- \nKarl Wiberg, kha@treskal.com\n   subrabbit.wordpress.com\n   www.treskal.com/kalle\n"}]}