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>maint
parent
502be95953
commit
100e762a60
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# An example hook script to check the commit log message.
|
# An example hook script to check the commit log message.
|
||||||
# Called by git-commit with one argument, the name of the file
|
# Called by "git commit" with one argument, the name of the file
|
||||||
# that has the commit message. The hook should exit with non-zero
|
# that has the commit message. The hook should exit with non-zero
|
||||||
# status after issuing an appropriate message if it wants to stop the
|
# status after issuing an appropriate message if it wants to stop the
|
||||||
# commit. The hook is allowed to edit the commit message file.
|
# commit. The hook is allowed to edit the commit message file.
|
||||||
|
|
|
@ -5,4 +5,4 @@
|
||||||
#
|
#
|
||||||
# To enable this hook, rename this file to "post-update".
|
# To enable this hook, rename this file to "post-update".
|
||||||
|
|
||||||
exec git-update-server-info
|
exec git update-server-info
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# An example hook script to verify what is about to be committed.
|
# An example hook script to verify what is about to be committed.
|
||||||
# Called by git-commit with no arguments. The hook should
|
# Called by "git commit" with no arguments. The hook should
|
||||||
# exit with non-zero status after issuing an appropriate message if
|
# exit with non-zero status after issuing an appropriate message if
|
||||||
# it wants to stop the commit.
|
# it wants to stop the commit.
|
||||||
#
|
#
|
||||||
# To enable this hook, rename this file to "pre-commit".
|
# To enable this hook, rename this file to "pre-commit".
|
||||||
|
|
||||||
if git-rev-parse --verify HEAD >/dev/null 2>&1
|
if git rev-parse --verify HEAD >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
against=HEAD
|
against=HEAD
|
||||||
else
|
else
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006, 2008 Junio C Hamano
|
# Copyright (c) 2006, 2008 Junio C Hamano
|
||||||
#
|
#
|
||||||
# The "pre-rebase" hook is run just before "git-rebase" starts doing
|
# The "pre-rebase" hook is run just before "git rebase" starts doing
|
||||||
# its job, and can prevent the command from running by exiting with
|
# its job, and can prevent the command from running by exiting with
|
||||||
# non-zero status.
|
# non-zero status.
|
||||||
#
|
#
|
||||||
|
@ -43,7 +43,7 @@ git show-ref -q "$topic" || {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Is topic fully merged to master?
|
# Is topic fully merged to master?
|
||||||
not_in_master=`git-rev-list --pretty=oneline ^master "$topic"`
|
not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
|
||||||
if test -z "$not_in_master"
|
if test -z "$not_in_master"
|
||||||
then
|
then
|
||||||
echo >&2 "$topic is fully merged to master; better remove it."
|
echo >&2 "$topic is fully merged to master; better remove it."
|
||||||
|
@ -51,11 +51,11 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Is topic ever merged to next? If so you should not be rebasing it.
|
# Is topic ever merged to next? If so you should not be rebasing it.
|
||||||
only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort`
|
only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
|
||||||
only_next_2=`git-rev-list ^master ${publish} | sort`
|
only_next_2=`git rev-list ^master ${publish} | sort`
|
||||||
if test "$only_next_1" = "$only_next_2"
|
if test "$only_next_1" = "$only_next_2"
|
||||||
then
|
then
|
||||||
not_in_topic=`git-rev-list "^$topic" master`
|
not_in_topic=`git rev-list "^$topic" master`
|
||||||
if test -z "$not_in_topic"
|
if test -z "$not_in_topic"
|
||||||
then
|
then
|
||||||
echo >&2 "$topic is already up-to-date with master"
|
echo >&2 "$topic is already up-to-date with master"
|
||||||
|
@ -64,7 +64,7 @@ then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"`
|
not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
|
||||||
@PERL_PATH@ -e '
|
@PERL_PATH@ -e '
|
||||||
my $topic = $ARGV[0];
|
my $topic = $ARGV[0];
|
||||||
my $msg = "* $topic has commits already merged to public branch:\n";
|
my $msg = "* $topic has commits already merged to public branch:\n";
|
||||||
|
@ -157,13 +157,13 @@ B to be deleted.
|
||||||
|
|
||||||
To compute (1):
|
To compute (1):
|
||||||
|
|
||||||
git-rev-list ^master ^topic next
|
git rev-list ^master ^topic next
|
||||||
git-rev-list ^master next
|
git rev-list ^master next
|
||||||
|
|
||||||
if these match, topic has not merged in next at all.
|
if these match, topic has not merged in next at all.
|
||||||
|
|
||||||
To compute (2):
|
To compute (2):
|
||||||
|
|
||||||
git-rev-list master..topic
|
git rev-list master..topic
|
||||||
|
|
||||||
if this is empty, it is fully merged to "master".
|
if this is empty, it is fully merged to "master".
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# An example hook script to prepare the commit log message.
|
# An example hook script to prepare the commit log message.
|
||||||
# Called by git-commit with the name of the file that has the
|
# Called by "git commit" with the name of the file that has the
|
||||||
# commit message, followed by the description of the commit
|
# commit message, followed by the description of the commit
|
||||||
# message's source. The hook's purpose is to edit the commit
|
# message's source. The hook's purpose is to edit the commit
|
||||||
# message file. If the hook fails with a non-zero status,
|
# message file. If the hook fails with a non-zero status,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# An example hook script to blocks unannotated tags from entering.
|
# An example hook script to blocks unannotated tags from entering.
|
||||||
# Called by git-receive-pack with arguments: refname sha1-old sha1-new
|
# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
|
||||||
#
|
#
|
||||||
# To enable this hook, rename this file to "update".
|
# To enable this hook, rename this file to "update".
|
||||||
#
|
#
|
||||||
|
@ -64,7 +64,7 @@ zero="0000000000000000000000000000000000000000"
|
||||||
if [ "$newrev" = "$zero" ]; then
|
if [ "$newrev" = "$zero" ]; then
|
||||||
newrev_type=delete
|
newrev_type=delete
|
||||||
else
|
else
|
||||||
newrev_type=$(git-cat-file -t $newrev)
|
newrev_type=$(git cat-file -t $newrev)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$refname","$newrev_type" in
|
case "$refname","$newrev_type" in
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# git-ls-files --others --exclude-from=.git/info/exclude
|
# git ls-files --others --exclude-from=.git/info/exclude
|
||||||
# Lines that start with '#' are comments.
|
# Lines that start with '#' are comments.
|
||||||
# For a project mostly in C, the following would be a good set of
|
# For a project mostly in C, the following would be a good set of
|
||||||
# exclude patterns (uncomment them if you want to use them):
|
# exclude patterns (uncomment them if you want to use them):
|
||||||
|
|
Loading…
Reference in New Issue