summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9da5c2f)
raw | patch | inline | side by side (parent: 9da5c2f)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 11 Feb 2006 02:38:24 +0000 (18:38 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 11 Feb 2006 02:44:31 +0000 (18:44 -0800) |
It was pointed out that otherwise more important summary
information prefixed with '#' would become prone to be missed.
Also instead of chopping at the first '^---$' line, stop at the
first 'diff --git a/' line.
Signed-off-by: Junio C Hamano <junkio@cox.net>
information prefixed with '#' would become prone to be missed.
Also instead of chopping at the first '^---$' line, stop at the
first 'diff --git a/' line.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-commit.sh | patch | blob | history |
diff --git a/git-commit.sh b/git-commit.sh
index e6793bd67e42375f33b900e27f04b9af14d6f27f..073ec81e14e8aa55df913b4452ead35fb73d5134 100755 (executable)
--- a/git-commit.sh
+++ b/git-commit.sh
if test -z "$initial_commit"
then
- if test -z "$verbose"
- then
- git-diff-index -M --cached --name-status \
- --diff-filter=MDTCRA HEAD |
- sed -e '
- s/\\/\\\\/g
- s/ /\\ /g
- ' |
- report "Updated but not checked in" "will commit"
- else
- if git-diff-index --cached -M -p --diff-filter=MDTCRA HEAD |
- grep .
- then
- false
- else
- true
- fi
- fi
+ git-diff-index -M --cached --name-status \
+ --diff-filter=MDTCRA HEAD |
+ sed -e '
+ s/\\/\\\\/g
+ s/ /\\ /g
+ ' |
+ report "Updated but not checked in" "will commit"
committable="$?"
else
echo '#
print "$_\n";
}
'
+
+ if test -n "$verbose"
+ then
+ git-diff-index --cached -M -p --diff-filter=MDTCRA HEAD
+ fi
case "$committable" in
0)
echo "nothing to commit"
PARENTS=""
fi
-{
- test -z "$verbose" || echo '---'
- run_status
-} >>"$GIT_DIR"/COMMIT_EDITMSG
+run_status >>"$GIT_DIR"/COMMIT_EDITMSG
if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" ]
then
rm -f "$GIT_DIR/COMMIT_EDITMSG"
esac
sed -e '
- /^---$/{
- s///
- q
- }
- /^#/d
+ /^diff --git a\/.*/{
+ s///
+ q
+ }
+ /^#/d
' "$GIT_DIR"/COMMIT_EDITMSG |
git-stripspace >"$GIT_DIR"/COMMIT_MSG