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>

Kaartic Sivaraam committed Jul 11, 2017 at 19:41 UTC 94eba456b4f94228f5f724ce512decb8934522c1
1 file changed +6 -3
templates/hooks--prepare-commit-msg.sample
+6 -3
@@ -19,14 +19,17 @@
19 # The second example adds a Signed-off-by line to the message, that can
20 # still be edited. This is rarely a good idea.
21
22 +COMMIT_MSG_FILE=$1
23 +COMMIT_SOURCE=$2
24 +SHA1=$3
25
23 -# case "$2,$3" in
26 +# case "$COMMIT_SOURCE,$SHA1" in
27 # ,|template,)
28 # @PERL_PATH@ -i.bak -pe '
29 # print "\n" . `git diff --cached --name-status -r`
27 -# if /^#/ && $first++ == 0' "$1" ;;
30 +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;;
31 # *) ;;
32 # esac
33
34 # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
32 -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
35 +# grep -qs "^$SOB" "$COMMIT_MSG_FILE" || echo "$SOB" >> "$COMMIT_MSG_FILE"