summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorKaartic Sivaraam <kaarticsivaraam91196@gmail.com>2017-07-11 14:11:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-07-12 20:20:40 (GMT)
commitb22a3079466b72e8a8b76065d6c28efe7eea4b16 (patch)
treefc3c4762eb106d903ac01ed6f5e21d76533b56e8 /templates
parent8b2efe2a0fd93b8721879f796d848a9ce785647f (diff)
downloadgit-b22a3079466b72e8a8b76065d6c28efe7eea4b16.zip
git-b22a3079466b72e8a8b76065d6c28efe7eea4b16.tar.gz
git-b22a3079466b72e8a8b76065d6c28efe7eea4b16.tar.bz2
hook: cleanup script
Prepare the 'preare-commit-msg' sample script for upcoming changes. Preparation includes removal of an example that has outlived it's purpose. The example is the one that comments the "Conflicts:" part of a merge commit message. It isn't relevant anymore as it's done by default since 261f315b ("merge & sequencer: turn "Conflicts:" hint into a comment", 2014-08-28). Further update the relevant comments from the sample script and update the documentation. 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.sample24
1 files changed, 10 insertions, 14 deletions
diff --git a/templates/hooks--prepare-commit-msg.sample b/templates/hooks--prepare-commit-msg.sample
index 86b8f22..279ddc1 100755
--- a/templates/hooks--prepare-commit-msg.sample
+++ b/templates/hooks--prepare-commit-msg.sample
@@ -9,28 +9,24 @@
#
# To enable this hook, rename this file to "prepare-commit-msg".
-# This hook includes three examples. The first comments out the
-# "Conflicts:" part of a merge commit.
+# This hook includes two examples.
#
-# The second includes the output of "git diff --name-status -r"
+# The first includes the output of "git diff --name-status -r"
# into the message, just before the "git status" output. It is
# commented because it doesn't cope with --amend or with squashed
# commits.
#
-# The third example adds a Signed-off-by line to the message, that can
+# The second example adds a Signed-off-by line to the message, that can
# still be edited. This is rarely a good idea.
-case "$2,$3" in
- merge,)
- @PERL_PATH@ -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
-# ,|template,)
-# @PERL_PATH@ -i.bak -pe '
-# print "\n" . `git diff --cached --name-status -r`
-# if /^#/ && $first++ == 0' "$1" ;;
-
- *) ;;
-esac
+# case "$2,$3" in
+# ,|template,)
+# @PERL_PATH@ -i.bak -pe '
+# print "\n" . `git diff --cached --name-status -r`
+# if /^#/ && $first++ == 0' "$1" ;;
+# *) ;;
+# esac
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"