Modernize git calling conventions in hook templates
The hook templates were still using/referencing 'git-foo' instead of 'git foo.' This patch updates the sample hooks to use the modern conventions instead. Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ben Walton committed
Mar 20, 2010 at 10:48 UTC
100e762a60a691a4978434f1cd5532e19cad39fc
7 files changed
+17
-17
templates/hooks--commit-msg.sample
+1
-1
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
#
3
# An example hook script to check the commit log message.
4
-# Called by git-commit with one argument, the name of the file
4
+# Called by "git commit" with one argument, the name of the file
5
# that has the commit message. The hook should exit with non-zero
6
# status after issuing an appropriate message if it wants to stop the
7
# commit. The hook is allowed to edit the commit message file.
templates/hooks--post-update.sample
+1
-1
@@ -5,4 +5,4 @@
5
#
6
# To enable this hook, rename this file to "post-update".
7
8
-exec git-update-server-info
8
+exec git update-server-info
templates/hooks--pre-commit.sample
+2
-2
@@ -1,13 +1,13 @@
1
#!/bin/sh
2
#
3
# An example hook script to verify what is about to be committed.
4
-# Called by git-commit with no arguments. The hook should
4
+# Called by "git commit" with no arguments. The hook should
5
# exit with non-zero status after issuing an appropriate message if
6
# it wants to stop the commit.
7
#
8
# To enable this hook, rename this file to "pre-commit".
9
10
-if git-rev-parse --verify HEAD >/dev/null 2>&1
10
+if git rev-parse --verify HEAD >/dev/null 2>&1
11
then
12
against=HEAD
13
else
templates/hooks--pre-rebase.sample
+9
-9
@@ -2,7 +2,7 @@
2
#
3
# Copyright (c) 2006, 2008 Junio C Hamano
4
#
5
-# The "pre-rebase" hook is run just before "git-rebase" starts doing
5
+# The "pre-rebase" hook is run just before "git rebase" starts doing
6
# its job, and can prevent the command from running by exiting with
7
# non-zero status.
8
#
@@ -43,7 +43,7 @@ git show-ref -q "$topic" || {
43
}
44
45
# Is topic fully merged to master?
46
-not_in_master=`git-rev-list --pretty=oneline ^master "$topic"`
46
+not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
47
if test -z "$not_in_master"
48
then
49
echo >&2 "$topic is fully merged to master; better remove it."
@@ -51,11 +51,11 @@ then
51
fi
52
53
# Is topic ever merged to next? If so you should not be rebasing it.
54
-only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort`
55
-only_next_2=`git-rev-list ^master ${publish} | sort`
54
+only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
55
+only_next_2=`git rev-list ^master ${publish} | sort`
56
if test "$only_next_1" = "$only_next_2"
57
then
58
- not_in_topic=`git-rev-list "^$topic" master`
58
+ not_in_topic=`git rev-list "^$topic" master`
59
if test -z "$not_in_topic"
60
then
61
echo >&2 "$topic is already up-to-date with master"
@@ -64,7 +64,7 @@ then
64
exit 0
65
fi
66
else
67
- not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"`
67
+ not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
68
@PERL_PATH@ -e '
69
my $topic = $ARGV[0];
70
my $msg = "* $topic has commits already merged to public branch:\n";
@@ -157,13 +157,13 @@ B to be deleted.
157
158
To compute (1):
159
160
- git-rev-list ^master ^topic next
161
- git-rev-list ^master next
160
+ git rev-list ^master ^topic next
161
+ git rev-list ^master next
162
163
if these match, topic has not merged in next at all.
164
165
To compute (2):
166
167
- git-rev-list master..topic
167
+ git rev-list master..topic
168
169
if this is empty, it is fully merged to "master".
templates/hooks--prepare-commit-msg.sample
+1
-1
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
#
3
# An example hook script to prepare the commit log message.
4
-# Called by git-commit with the name of the file that has the
4
+# Called by "git commit" with the name of the file that has the
5
# commit message, followed by the description of the commit
6
# message's source. The hook's purpose is to edit the commit
7
# message file. If the hook fails with a non-zero status,
templates/hooks--update.sample
+2
-2
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
#
3
# An example hook script to blocks unannotated tags from entering.
4
-# Called by git-receive-pack with arguments: refname sha1-old sha1-new
4
+# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
5
#
6
# To enable this hook, rename this file to "update".
7
#
@@ -64,7 +64,7 @@ zero="0000000000000000000000000000000000000000"
64
if [ "$newrev" = "$zero" ]; then
65
newrev_type=delete
66
else
67
- newrev_type=$(git-cat-file -t $newrev)
67
+ newrev_type=$(git cat-file -t $newrev)
68
fi
69
70
case "$refname","$newrev_type" in
templates/info--exclude
+1
-1
@@ -1,4 +1,4 @@
1
-# git-ls-files --others --exclude-from=.git/info/exclude
1
+# git ls-files --others --exclude-from=.git/info/exclude
2
# Lines that start with '#' are comments.
3
# For a project mostly in C, the following would be a good set of
4
# exclude patterns (uncomment them if you want to use them):