зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
8ab3e18586
Коммит
3d84df43e1
|
@ -148,7 +148,7 @@ case "$refname_type" in
|
||||||
# This shows all log entries that are not already covered by
|
# This shows all log entries that are not already covered by
|
||||||
# another ref - i.e. commits that are now accessible from this
|
# another ref - i.e. commits that are now accessible from this
|
||||||
# ref that were previously not accessible
|
# ref that were previously not accessible
|
||||||
git-rev-parse --not --all | git-rev-list --stdin --pretty $newref
|
git log $newrev --not --all
|
||||||
echo $LOGEND
|
echo $LOGEND
|
||||||
else
|
else
|
||||||
# oldrev is valid
|
# oldrev is valid
|
||||||
|
@ -165,7 +165,7 @@ case "$refname_type" in
|
||||||
baserev=$(git-merge-base $oldrev $newrev)
|
baserev=$(git-merge-base $oldrev $newrev)
|
||||||
|
|
||||||
# Commit with a parent
|
# 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
|
do
|
||||||
revtype=$(git-cat-file -t "$rev")
|
revtype=$(git-cat-file -t "$rev")
|
||||||
echo " via $rev ($revtype)"
|
echo " via $rev ($revtype)"
|
||||||
|
@ -190,12 +190,11 @@ case "$refname_type" in
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo $LOGBEGIN
|
echo $LOGBEGIN
|
||||||
git-rev-parse --not --all |
|
git log $newrev --not $baserev --all
|
||||||
git-rev-list --stdin --pretty $newrev ^$baserev
|
|
||||||
echo $LOGEND
|
echo $LOGEND
|
||||||
echo ""
|
echo ""
|
||||||
echo "Diffstat:"
|
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
|
fi
|
||||||
;;
|
;;
|
||||||
"annotated tag")
|
"annotated tag")
|
||||||
|
|
Загрузка…
Ссылка в новой задаче