aboutsummaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-12-30 12:37:59 -0800
committerJunio C Hamano <gitster@pobox.com>2007-12-30 12:37:59 -0800
commit8ad1065e580c03035c583e2d237cc5b76f90cee4 (patch)
treef04b621af7b2be35ee8ef6c21c6057243604a321 /git-rebase--interactive.sh
parentd6ed263fc7458e97ad032837ffdab6013d039543 (diff)
downloadgit-8ad1065e580c03035c583e2d237cc5b76f90cee4.tar.gz
git-8ad1065e580c03035c583e2d237cc5b76f90cee4.tar.xz
git-rebase -i behaves better on commits with incomplete messages
The commit message template when squashing multiple commits is prepared by concatenating the messages of existing commits together. If the messages from some of them end with incomplete lines, this would result in a suboptimal message template. Make sure that we add a terminating LF after each commit message. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rwxr-xr-xgit-rebase--interactive.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 090c3e514..d0d83c35e 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -215,15 +215,17 @@ make_squash_message () {
COUNT=$(($(sed -n "s/^# This is [^0-9]*\([1-9][0-9]*\).*/\1/p" \
< "$SQUASH_MSG" | tail -n 1)+1))
echo "# This is a combination of $COUNT commits."
- sed -n "2,\$p" < "$SQUASH_MSG"
+ sed -e 1d -e '2,/^./{
+ /^$/d
+ }' <"$SQUASH_MSG"
else
COUNT=2
echo "# This is a combination of two commits."
echo "# The first commit's message is:"
echo
git cat-file commit HEAD | sed -e '1,/^$/d'
- echo
fi
+ echo
echo "# This is the $(nth_string $COUNT) commit message:"
echo
git cat-file commit $1 | sed -e '1,/^$/d'