git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[StGit PATCH] Don't use the dashed for of git commands

From
Karl Hasselström <kha@treskal.com>
Date
Aug 27, 2008, 00:30 UTC
Message-ID
<20080827002827.14720.45394.stgit@yoghurt>

With the release of git 1.6.0, the dashed forms of the git commands are no longer installed in $PATH by default, so trying to use them is likely to fail. This patch replaces all remaining dashed git calls by their dashless equivalents -- even in comments and docs, for consistency and to aid grepping.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---

This is for the stable branch. kha/safe contains a merge of this into the master branch, which you might want to steal since there were a fair amount of conflicts to resolve.

 .mailmap                    |    2 +-
 Documentation/tutorial.txt  |    2 +-
 contrib/release/post-update |    2 +-
 contrib/release/release.sh  |    2 +-
 contrib/release/snapshot.sh |    2 +-
 contrib/stg-cvs             |    8 ++++----
 contrib/stg-gitk            |    6 +++---
 contrib/stg-whatchanged     |    2 +-
 contrib/stgbashprompt.sh    |    4 ++--
 examples/gitconfig          |    8 ++++----
 stgit/commands/diff.py      |    2 +-
 stgit/commands/edit.py      |    2 +-
 stgit/commands/export.py    |    2 +-
 stgit/commands/files.py     |    2 +-
 stgit/commands/mail.py      |    2 +-
 stgit/commands/pick.py      |    2 +-
 stgit/gitmergeonefile.py    |    2 +-
 t/README                    |   18 +++++++++---------
 t/t1200-push-modified.sh    |    4 ++--
 t/t1201-pull-trailing.sh    |    4 ++--
 t/t1302-repair-interop.sh   |    6 +++---
 t/test-lib.sh               |    8 ++++----
 22 files changed, 46 insertions(+), 46 deletions(-)
diff --git a/.mailmap b/.mailmap
index ecaafff..cdb1beb 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1,4 +1,4 @@
-# This list is used by git-shortlog to fix a few botched name
+# This list is used by various git commands to fix a few botched name
 # translations in the StGIT repository.
 
 Bryan Larsen <bryan.larsen@gmail.com>
diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
index 2b8e4e7..b040d29 100644
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -32,7 +32,7 @@ Repository initialisation
 -------------------------
 
 In stand-alone mode, StGIT is used in conjunction with a GIT repository
-that is already initialised (using 'git-init-db'). StGIT cannot be used
+that is already initialised (using 'git init'). StGIT cannot be used
 outside of a GIT repository.
 Any branch in a GIT repository may be managed by StGIT. Each branch
 managed by StGIT contains an independent series of StGIT patches.
diff --git a/contrib/release/post-update b/contrib/release/post-update
index d7ae4ca..6cbad71 100755
--- a/contrib/release/post-update
+++ b/contrib/release/post-update
@@ -6,7 +6,7 @@
 # To enable this hook, make this file executable by "chmod +x post-update".
 
 git repack -d
-git-update-server-info
+git update-server-info
 
 # FTP upload
 lftp ftp://your-ftp-site/stgit.git -u username,password -e " \
diff --git a/contrib/release/release.sh b/contrib/release/release.sh
index 7c2d0b9..7fada5d 100755
--- a/contrib/release/release.sh
+++ b/contrib/release/release.sh
@@ -13,7 +13,7 @@ BINRPM=dist/stgit-$VERSION-1.noarch.rpm
 SRCRPM=dist/stgit-$VERSION-1.src.rpm
 DEBPKG=../stgit_$VERSION-0_all.deb
 
-git-rev-list --pretty HEAD > ChangeLog
+git rev-list --pretty HEAD > ChangeLog
 
 rm -f MANIFEST
 
diff --git a/contrib/release/snapshot.sh b/contrib/release/snapshot.sh
index a81df52..71b447f 100755
--- a/contrib/release/snapshot.sh
+++ b/contrib/release/snapshot.sh
@@ -5,7 +5,7 @@
 VERSION=`date "+%Y%m%d"`
 SNAPSHOT=dist/stgit-$VERSION.tar.gz
 
-git-rev-list --pretty HEAD > ChangeLog
+git rev-list --pretty HEAD > ChangeLog
 
 mv stgit/version.py stgit/version.py-
 echo "version = '$VERSION'" > stgit/version.py
diff --git a/contrib/stg-cvs b/contrib/stg-cvs
index 582f4f2..393c982 100755
--- a/contrib/stg-cvs
+++ b/contrib/stg-cvs
@@ -39,11 +39,11 @@ set -e
 #   VCS
 # - lacks synchronisation of .cvsignore <-> .gitignore
 # - no support for filenames with spaces (stg lacks --zero output format)
-# - git-commit is too chatty when it finds nothing to commit
+# - git commit is too chatty when it finds nothing to commit
 # - lacks a "quick cvs commit" feature
 
 # DESIGN FLAWS
-# - while fetching, if a file change was not git-update-index'd when
+# - while fetching, if a file change was not git update-index'd when
 #   cvs-update'd (eg. because of a stg-cvs bug), it is not seen on further
 #   fetches until it changes again, since we scan "cvs update" output.
 #   This yields possible inconsistencies with CVS.
@@ -116,7 +116,7 @@ cvs_add_dir()
 
 # get context
 branch=$(stg branch)
-parent=$(git-config "branch.${branch}.stgit.parentbranch") || 
+parent=$(git config "branch.${branch}.stgit.parentbranch") || 
     usage "no declared parent for '$branch' - set branch.${branch}.stgit.parentbranch"
 
 # extract command
@@ -165,7 +165,7 @@ commit)
 
     # sync the parent branch
     stg branch "$parent"
-    git-cherry-pick "patches/${branch}/${patch}"
+    git cherry-pick "patches/${branch}/${patch}"
     stg branch "${branch}"
 
     # update
diff --git a/contrib/stg-gitk b/contrib/stg-gitk
index cb264e5..e3ddfb1 100755
--- a/contrib/stg-gitk
+++ b/contrib/stg-gitk
@@ -40,7 +40,7 @@ if [ $allbranches = 1 ] && [ "$branches" != "" ]; then
     usage
 fi
 
-GIT_DIR=$(git-rev-parse --git-dir)
+GIT_DIR=$(git rev-parse --git-dir)
 GIT_DIR_SPKIPLEN=$(printf "$GIT_DIR/X" | wc -c)
 
 refdirs=''
@@ -64,9 +64,9 @@ else
 	elif [ -e "$GIT_DIR/refs/heads/$b" ]; then
 	    # other GIT branch
 	    refdirs="$refdirs $GIT_DIR/refs/heads/$b"
-	elif [ $(git-for-each-ref "refs/$b" | wc -l) != 0 ]; then
+	elif [ $(git for-each-ref "refs/$b" | wc -l) != 0 ]; then
 	    # other ref
-	    refdirs="$refdirs $(git-for-each-ref --format="$GIT_DIR/%(refname)" "refs/$b")"
+	    refdirs="$refdirs $(git for-each-ref --format="$GIT_DIR/%(refname)" "refs/$b")"
 	else
 	    echo >&2 "ERROR: no such ref '$b'"
 	    usage
diff --git a/contrib/stg-whatchanged b/contrib/stg-whatchanged
index afeda2c..f1f5308 100755
--- a/contrib/stg-whatchanged
+++ b/contrib/stg-whatchanged
@@ -23,7 +23,7 @@ fi
 
 # Merges via "push" leave top=bottom so we must look at old patch
 # in this case (unlike, eg., "pick --fold")
-patchdir="$(git-rev-parse --git-dir)/patches/$(stg branch)/patches/$(stg top)"
+patchdir="$(git rev-parse --git-dir)/patches/$(stg branch)/patches/$(stg top)"
 case $(stg log | head -n1) in
     *push\(c\)*) former="//top.old" ;;
     *) former="//top" ;;
diff --git a/contrib/stgbashprompt.sh b/contrib/stgbashprompt.sh
index 5927e67..d5c4994 100755
--- a/contrib/stgbashprompt.sh
+++ b/contrib/stgbashprompt.sh
@@ -5,8 +5,8 @@ if [ "$PS1" ]; then
 	function __prompt_git()
 	{
 		local git_dir ref br top;
-		git_dir=$(git-rev-parse --git-dir 2> /dev/null) || return
-		ref=$(git-symbolic-ref HEAD 2> /dev/null) || return
+		git_dir=$(git rev-parse --git-dir 2> /dev/null) || return
+		ref=$(git symbolic-ref HEAD 2> /dev/null) || return
 		br=${ref#refs/heads/}
 		top=$(tail -n 1 $git_dir/patches/$br/applied 2>/dev/null) \
 		top=${top:-(none)}
diff --git a/examples/gitconfig b/examples/gitconfig
index 52d2a69..b7a6629 100644
--- a/examples/gitconfig
+++ b/examples/gitconfig
@@ -42,14 +42,14 @@
 	#pager = filterdiff --annotate | colordiff | less -FRX
 
 	# GIT pull and fetch commands (should take the same arguments as
-	# git-fetch or git-pull).  By default:
-	#pullcmd = git-pull
-	#fetchcmd = git-fetch
+	# git fetch or git pull).  By default:
+	#pullcmd = git pull
+	#fetchcmd = git fetch
 
 	# Rebase command. Note that this command is internally implemented in
 	# a different way. Only define this option if a different rebase
 	# is needed (i.e. 'git svn rebase')
-	#rebasecmd = git-reset
+	#rebasecmd = git reset
 
 	# "stg pull" policy.  This is the repository default, which can be
 	# overriden on a per-branch basis using branch.*.stgit.pull-policy
diff --git a/stgit/commands/diff.py b/stgit/commands/diff.py
index 1425518..791b1ce 100644
--- a/stgit/commands/diff.py
+++ b/stgit/commands/diff.py
@@ -47,7 +47,7 @@ options = [make_option('-r', '--range',
                        metavar = 'rev1[..[rev2]]', dest = 'revs',
                        help = 'show the diff between revisions'),
            make_option('-O', '--diff-opts',
-                       help = 'options to pass to git-diff'),
+                       help = 'options to pass to git diff'),
            make_option('-s', '--stat',
                        help = 'show the stat instead of the diff',
                        action = 'store_true')]
diff --git a/stgit/commands/edit.py b/stgit/commands/edit.py
index a4d8f96..36d2e01 100644
--- a/stgit/commands/edit.py
+++ b/stgit/commands/edit.py
@@ -64,7 +64,7 @@ options = [make_option('-d', '--diff',
            make_option('-f', '--file',
                        help = 'use FILE instead of invoking the editor'),
            make_option('-O', '--diff-opts',
-                       help = 'options to pass to git-diff'),
+                       help = 'options to pass to git diff'),
            make_option('--undo',
                        help = 'revert the commit generated by the last edit',
                        action = 'store_true'),
diff --git a/stgit/commands/export.py b/stgit/commands/export.py
index 4e52598..c4fb7e3 100644
--- a/stgit/commands/export.py
+++ b/stgit/commands/export.py
@@ -65,7 +65,7 @@ options = [make_option('-d', '--dir',
            make_option('-b', '--branch',
                        help = 'use BRANCH instead of the default one'),
            make_option('-O', '--diff-opts',
-                       help = 'options to pass to git-diff'),
+                       help = 'options to pass to git diff'),
            make_option('-s', '--stdout',
                        help = 'dump the patches to the standard output',
                        action = 'store_true')]
diff --git a/stgit/commands/files.py b/stgit/commands/files.py
index 4550251..cc9ed30 100644
--- a/stgit/commands/files.py
+++ b/stgit/commands/files.py
@@ -41,7 +41,7 @@ options = [make_option('-s', '--stat',
            make_option('-b', '--branch',
                        help = 'use BRANCH instead of the default one'),
            make_option('-O', '--diff-opts',
-                       help = 'options to pass to git-diff'),
+                       help = 'options to pass to git diff'),
            make_option('--bare',
                        help = 'bare file names (useful for scripting)',
                        action = 'store_true')]
diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index 54ab5c9..05c905b 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -145,7 +145,7 @@ options = [make_option('-a', '--all',
            make_option('-b', '--branch',
                        help = 'use BRANCH instead of the default one'),
            make_option('-O', '--diff-opts',
-                       help = 'options to pass to git-diff'),
+                       help = 'options to pass to git diff'),
            make_option('-m', '--mbox',
                        help = 'generate an mbox file instead of sending',
                        action = 'store_true')]
diff --git a/stgit/commands/pick.py b/stgit/commands/pick.py
index f9ee7c2..add2a33 100644
--- a/stgit/commands/pick.py
+++ b/stgit/commands/pick.py
@@ -81,7 +81,7 @@ def __pick_commit(commit_id, patchname, options):
     if options.fold:
         out.start('Folding commit %s' % commit_id)
 
-        # try a direct git-apply first
+        # try a direct git apply first
         if not git.apply_diff(bottom, top):
             git.merge(bottom, git.get_head(), top, recursive = True)
 
diff --git a/stgit/gitmergeonefile.py b/stgit/gitmergeonefile.py
index 4c90e1a..c1af2f8 100644
--- a/stgit/gitmergeonefile.py
+++ b/stgit/gitmergeonefile.py
@@ -159,7 +159,7 @@ def merge(orig_hash, file1_hash, file2_hash,
     if orig_hash:
         # modified in both
         if file1_hash and file2_hash:
-            # if modes are the same (git-read-tree probably dealt with it)
+            # if modes are the same (git read-tree probably dealt with it)
             if file1_hash == file2_hash:
                 if os.system('git update-index --cacheinfo %s %s %s'
                              % (file1_mode, file1_hash, path)) != 0:
diff --git a/t/README b/t/README
index 77f0b6c..ffb3c66 100644
--- a/t/README
+++ b/t/README
@@ -22,11 +22,11 @@ The easiest way to run tests is to say "make -C t".  This runs all
 the tests.
 
     *** t0000-basic.sh ***
-    *   ok 1: .git/objects should be empty after git-init-db in an empty repo.
+    *   ok 1: .git/objects should be empty after git init in an empty repo.
     *   ok 2: .git/objects should have 256 subdirectories.
-    *   ok 3: git-update-index without --add should fail adding.
+    *   ok 3: git update-index without --add should fail adding.
     ...
-    *   ok 23: no diff after checkout and git-update-index --refresh.
+    *   ok 23: no diff after checkout and git update-index --refresh.
     * passed all 23 test(s)
     *** t0100-environment-names.sh ***
     *   ok 1: using old names should issue warnings.
@@ -37,9 +37,9 @@ Or you can run each test individually from command line, like
 this:
 
     $ sh ./t3001-ls-files-killed.sh
-    *   ok 1: git-update-index --add to add various paths.
-    *   ok 2: git-ls-files -k to show killed files.
-    *   ok 3: validate git-ls-files -k output.
+    *   ok 1: git update-index --add to add various paths.
+    *   ok 2: git ls-files -k to show killed files.
+    *   ok 3: validate git ls-files -k output.
     * passed all 3 test(s)
 
 You can pass --verbose (or -v), --debug (or -d), and --immediate
@@ -105,7 +105,7 @@ assignment to variable 'test_description', like this:
 	test_description='xxx test (option --frotz)
 
 	This test registers the following structure in the cache
-	and tries to run git-ls-files with option --frotz.'
+	and tries to run git ls-files with option --frotz.'
 
 
 Source 'test-lib.sh'
@@ -154,8 +154,8 @@ library for your script to use.
    Example:
 
 	test_expect_success \
-	    'git-write-tree should be able to write an empty tree.' \
-	    'tree=$(git-write-tree)'
+	    'git write-tree should be able to write an empty tree.' \
+	    'tree=$(git write-tree)'
 
  - test_expect_failure <message> <script>
 
diff --git a/t/t1200-push-modified.sh b/t/t1200-push-modified.sh
index cfec696..647c200 100755
--- a/t/t1200-push-modified.sh
+++ b/t/t1200-push-modified.sh
@@ -35,8 +35,8 @@ test_expect_success \
     'Port those patches to orig tree' '
     (
         cd foo &&
-        GIT_DIR=../bar/.git git-format-patch --stdout \
-          $(cd ../bar && stg id base@master)..HEAD | git-am -3 -k
+        GIT_DIR=../bar/.git git format-patch --stdout \
+          $(cd ../bar && stg id base@master)..HEAD | git am -3 -k
     )
 '
 
diff --git a/t/t1201-pull-trailing.sh b/t/t1201-pull-trailing.sh
index 46d9f82..805e805 100755
--- a/t/t1201-pull-trailing.sh
+++ b/t/t1201-pull-trailing.sh
@@ -29,9 +29,9 @@ test_expect_success \
 test_expect_success \
     'Port those patches to orig tree' \
     '(cd foo &&
-      GIT_DIR=../bar/.git git-format-patch --stdout \
+      GIT_DIR=../bar/.git git format-patch --stdout \
           $(cd ../bar && stg id base@master)..HEAD |
-      git-am -3 -k
+      git am -3 -k
      )
     '
 
diff --git a/t/t1302-repair-interop.sh b/t/t1302-repair-interop.sh
index 82c5ed2..910b23a 100755
--- a/t/t1302-repair-interop.sh
+++ b/t/t1302-repair-interop.sh
@@ -25,7 +25,7 @@ test_expect_success 'Create five patches' '
     [ "$(echo $(stg unapplied))" = "" ]
 '
 
-test_expect_success 'Pop two patches with git-reset' '
+test_expect_success 'Pop two patches with git reset' '
     git reset --hard HEAD~2 &&
     ! stg refresh &&
     stg repair &&
@@ -40,7 +40,7 @@ test_expect_success 'Create a new patch' '
     [ "$(echo $(stg unapplied))" = "p3 p4" ]
 '
 
-test_expect_success 'Go to an unapplied patch with with git-reset' '
+test_expect_success 'Go to an unapplied patch with with git reset' '
     git reset --hard $(stg id p3) &&
     ! stg refresh &&
     stg repair &&
@@ -49,7 +49,7 @@ test_expect_success 'Go to an unapplied patch with with git-reset' '
     [ "$(echo $(stg unapplied))" = "q0 p4" ]
 '
 
-test_expect_success 'Go back to below the stack base with git-reset' '
+test_expect_success 'Go back to below the stack base with git reset' '
     git reset --hard foo-tag &&
     stg repair &&
     [ "$(echo $(stg applied))" = "" ] &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 2d12f1b..3d114a2 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -226,12 +226,12 @@ test_create_repo () {
 	repo="$1"
 	mkdir "$repo"
 	cd "$repo" || error "Cannot setup test environment"
-	git-init >/dev/null 2>&1 ||
-	error "cannot run git-init -- have you installed git-core?"
+	git init >/dev/null 2>&1 ||
+	error "cannot run git init -- have you installed git-core?"
 	mkdir .git/info
 	echo "empty start" |
-	git-commit-tree `git-write-tree` >.git/refs/heads/master 2>&4 ||
-	error "cannot run git-commit -- is your git-core functioning?"
+	git commit-tree `git write-tree` >.git/refs/heads/master 2>&4 ||
+	error "cannot run git commit -- is your git-core functioning?"
 	cd "$owd"
 }
 
Next: Daniel White
Message 1 of 6 in “Don't use the dashed for of git commands”
  1. Don't use the dashed for of git commandsKarl Hasselström, Aug 27, 2008
  2. Remove dashed form of git command still in commentDaniel White, Aug 27, 2008
  3. Karl HasselströmAug 27, 2008
  4. Daniel WhiteAug 27, 2008
  5. Karl HasselströmAug 27, 2008
  6. Catalin MarinasAug 30, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.