Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaartic Sivaraam <kaarticsivaraam91196@gmail.com>2017-07-11 17:11:09 +0300
committerJunio C Hamano <gitster@pobox.com>2017-07-12 23:20:42 +0300
commit94eba456b4f94228f5f724ce512decb8934522c1 (patch)
treecd36a1e218c30fbfa29afeda6aef45cdbf14c9d1 /templates
parentb22a3079466b72e8a8b76065d6c28efe7eea4b16 (diff)
hook: name the positional variables
It's always nice to have named variables instead of positional variables as they communicate their purpose well. Appropriately name the positional variables of the hook to make it easier to see what's going on. Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/hooks--prepare-commit-msg.sample9
1 files changed, 6 insertions, 3 deletions
diff --git a/templates/hooks--prepare-commit-msg.sample b/templates/hooks--prepare-commit-msg.sample
index 279ddc1a72..eb59121637 100755
--- a/templates/hooks--prepare-commit-msg.sample
+++ b/templates/hooks--prepare-commit-msg.sample
@@ -19,14 +19,17 @@
# The second example adds a Signed-off-by line to the message, that can
# still be edited. This is rarely a good idea.
+COMMIT_MSG_FILE=$1
+COMMIT_SOURCE=$2
+SHA1=$3
-# case "$2,$3" in
+# case "$COMMIT_SOURCE,$SHA1" in
# ,|template,)
# @PERL_PATH@ -i.bak -pe '
# print "\n" . `git diff --cached --name-status -r`
-# if /^#/ && $first++ == 0' "$1" ;;
+# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;;
# *) ;;
# esac
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
-# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
+# grep -qs "^$SOB" "$COMMIT_MSG_FILE" || echo "$SOB" >> "$COMMIT_MSG_FILE"