You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This script is based on the prepare-commit-msg.sample file in a git repo.
3
+
# This script is based on the prepare-commit-msg.sample file that comes by default in any git repo when you run git init or git clone (you can also run git init later on to restore hooks).
4
+
# Note everything here is uncommented but you're only meant to run one of the 3 sections after setting up vars.
4
5
6
+
# e.g. '.git/COMMIT_EDITMSG'
5
7
COMMIT_MSG_FILE=$1
8
+
# e.g. 'message' or 'template'
6
9
COMMIT_SOURCE=$2
10
+
# A hash, if relevant.
7
11
SHA1=$3
8
12
13
+
###
14
+
9
15
# Remove line.
10
16
/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)'"$COMMIT_MSG_FILE"
11
17
12
-
LINES=$(git status -s -uno --porcelain | wc -l)
13
-
# Write over
14
-
# echo "Files changed: $LINES" > $COMMIT_MSG_FILE
18
+
###
15
19
16
20
# Show files change.
17
-
# (Uncomments files changed in the message)
21
+
# (It will uncomment files changed in the message - which is maybe less efficient than just running git status but this is what git comes with.)
0 commit comments