Code

rebase -i: Improve consistency of commit count in generated commit messages
authorMichael Haggerty <mhagger@alum.mit.edu>
Thu, 14 Jan 2010 05:54:49 +0000 (06:54 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Jan 2010 08:27:56 +0000 (00:27 -0800)
Use the numeral "2" instead of the word "two" when two commits are
being interactively squashed.  This makes the treatment consistent
with that for higher numbers of commits.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase--interactive.sh
t/t3404-rebase-interactive.sh

index 31f9b3b038c5f535d4deaf2a507d336d128caa4d..702c979414033a685973c126042631c4469c3454 100755 (executable)
@@ -360,7 +360,7 @@ make_squash_message () {
                }' <"$SQUASH_MSG"
        else
                COUNT=2
-               echo "# This is a combination of two commits."
+               echo "# This is a combination of 2 commits."
                echo "# The first commit's message is:"
                echo
                git cat-file commit HEAD | sed -e '1,/^$/d'
index 0335b781a0f4c1584b33326e648e73083edba70f..05117091eb173ad84a4308229b8282278bb401c9 100755 (executable)
@@ -135,7 +135,7 @@ test_expect_success 'squash' '
        test_tick &&
        GIT_AUTHOR_NAME="Nitfol" git commit -m "nitfol" file7 &&
        echo "******************************" &&
-       FAKE_LINES="1 squash 2" EXPECT_HEADER_COUNT=two \
+       FAKE_LINES="1 squash 2" EXPECT_HEADER_COUNT=2 \
                git rebase -i --onto master HEAD~2 &&
        test B = $(cat file7) &&
        test $(git rev-parse HEAD^) = $(git rev-parse master)
@@ -301,7 +301,7 @@ test_expect_success 'squash works as expected' '
                git commit -m $n
        done &&
        one=$(git rev-parse HEAD~3) &&
-       FAKE_LINES="1 squash 3 2" EXPECT_HEADER_COUNT=two \
+       FAKE_LINES="1 squash 3 2" EXPECT_HEADER_COUNT=2 \
                git rebase -i HEAD~3 &&
        test $one = $(git rev-parse HEAD~2)
 '