git-commit -v: have patch at the end.

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>
This commit is contained in:
Junio C Hamano 2006-02-10 18:38:24 -08:00
Родитель 9da5c2f0d7
Коммит 9ae6be8016
1 изменённых файлов: 18 добавлений и 27 удалений

Просмотреть файл

@ -87,24 +87,13 @@ run_status () {
if test -z "$initial_commit" if test -z "$initial_commit"
then then
if test -z "$verbose" git-diff-index -M --cached --name-status \
then --diff-filter=MDTCRA HEAD |
git-diff-index -M --cached --name-status \ sed -e '
--diff-filter=MDTCRA HEAD | s/\\/\\\\/g
sed -e ' s/ /\\ /g
s/\\/\\\\/g ' |
s/ /\\ /g report "Updated but not checked in" "will commit"
' |
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
committable="$?" committable="$?"
else else
echo '# echo '#
@ -155,6 +144,11 @@ run_status () {
print "$_\n"; print "$_\n";
} }
' '
if test -n "$verbose"
then
git-diff-index --cached -M -p --diff-filter=MDTCRA HEAD
fi
case "$committable" in case "$committable" in
0) 0)
echo "nothing to commit" echo "nothing to commit"
@ -578,10 +572,7 @@ else
PARENTS="" PARENTS=""
fi fi
{ run_status >>"$GIT_DIR"/COMMIT_EDITMSG
test -z "$verbose" || echo '---'
run_status
} >>"$GIT_DIR"/COMMIT_EDITMSG
if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" ] if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" ]
then then
rm -f "$GIT_DIR/COMMIT_EDITMSG" rm -f "$GIT_DIR/COMMIT_EDITMSG"
@ -612,11 +603,11 @@ t)
esac esac
sed -e ' sed -e '
/^---$/{ /^diff --git a\/.*/{
s/// s///
q q
} }
/^#/d /^#/d
' "$GIT_DIR"/COMMIT_EDITMSG | ' "$GIT_DIR"/COMMIT_EDITMSG |
git-stripspace >"$GIT_DIR"/COMMIT_MSG git-stripspace >"$GIT_DIR"/COMMIT_MSG