hooks: use 'git do-something' instead of the old 'git-do-something'
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 15 Jul 2010 15:35:40 +0000 (16:35 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 15 Jul 2010 15:35:40 +0000 (16:35 +0100)
hooks/pre-commit.hook
hooks/pre-receive.hook

index 607c991..aef1ce1 100755 (executable)
@@ -46,7 +46,7 @@ INDENT_PARAMETERS="--braces-on-if-line \
        --leave-preprocessor-space"
 
 echo "--Checking style--"
-for file in `git-diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
+for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
     # nf is the temporary checkout. This makes sure we check against the
     # revision in the index (and not the checked out version).
     nf=`git checkout-index --temp ${file} | cut -f 1`
index 8ddcd87..ca1ef83 100644 (file)
@@ -12,7 +12,7 @@ import subprocess
 def commit_exists(sha1, gitdir):
     """Returns True if the sha1 is a valid commit in the given
     git directory"""
-    # FIXME: We're using git-show for the time being, but there's a small
+    # FIXME: We're using 'git show' for the time being, but there's a small
     # risk that there might be a valid SHA1 for a non-commit object.
     env = os.environ.copy()
     env["GIT_DIR"] = gitdir
@@ -39,7 +39,7 @@ for line in sys.stdin.readlines():
     old, new, ref = line.split(' ', 2)
 
     # 1. Get the latest change to common (if there was any changes)
-    sub = subprocess.Popen(["git-diff", "%s..%s" % (old, new, ), "--", "common"],
+    sub = subprocess.Popen(["git", "diff", "%s..%s" % (old, new, ), "--", "common"],
                            stdout=subprocess.PIPE)
     stdout, stderr = sub.communicate()
     if stdout != "":