summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorAndy Parkins <andyparkins@gmail.com>2007-03-02 19:29:20 +0000
committerJunio C Hamano <junkio@cox.net>2007-03-02 15:06:25 -0800
commit3d84df43e134d01cb790ddd47a14963ecd110152 (patch)
tree5ef30ae20101080c6b1622a39a829a2830d939e2 /templates
parent8ab3e1858676b91bf351537b8afd5599c6640e6f (diff)
downloadgit-3d84df43e134d01cb790ddd47a14963ecd110152.tar.gz
Sample update hook: typofix and modernization to use "git log"
Instead of using antiquated "git-rev-parse | git-rev-list" pipeline, it is easier to use "git-rev-list" or "git-log" these days, as Linus points out. While we are at it, fix the typo on variable name $newref that should be $newrev. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'templates')
-rw-r--r--templates/hooks--update9
1 files changed, 4 insertions, 5 deletions
diff --git a/templates/hooks--update b/templates/hooks--update
index fd1f73d6aa..4af2fe8d95 100644
--- a/templates/hooks--update
+++ b/templates/hooks--update
@@ -148,7 +148,7 @@ case "$refname_type" in
# This shows all log entries that are not already covered by
# another ref - i.e. commits that are now accessible from this
# ref that were previously not accessible
- git-rev-parse --not --all | git-rev-list --stdin --pretty $newref
+ git log $newrev --not --all
echo $LOGEND
else
# oldrev is valid
@@ -165,7 +165,7 @@ case "$refname_type" in
baserev=$(git-merge-base $oldrev $newrev)
# Commit with a parent
- for rev in $(git-rev-parse --not --all | git-rev-list --stdin $newrev ^$baserev)
+ for rev in $(git-rev-list $newrev --not $baserev --all)
do
revtype=$(git-cat-file -t "$rev")
echo " via $rev ($revtype)"
@@ -190,12 +190,11 @@ case "$refname_type" in
fi
echo ""
echo $LOGBEGIN
- git-rev-parse --not --all |
- git-rev-list --stdin --pretty $newrev ^$baserev
+ git log $newrev --not $baserev --all
echo $LOGEND
echo ""
echo "Diffstat:"
- git-diff-tree --no-color --stat -M -C --find-copies-harder $newrev ^$baserev
+ git-diff-tree --no-color --stat -M -C --find-copies-harder $baserev..$newrev
fi
;;
"annotated tag")