From: Junio C Hamano Date: Sat, 4 Dec 2010 00:13:06 +0000 (-0800) Subject: Merge branch 'pn/commit-autosquash' X-Git-Tag: v1.7.4-rc0~90 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9bec60d3a52fa10b276214f8d255d6ff05a04b77;p=git.git Merge branch 'pn/commit-autosquash' * pn/commit-autosquash: add tests of commit --squash commit: --squash option for use with rebase --autosquash add tests of commit --fixup commit: --fixup option for use with rebase --autosquash pretty.c: teach format_commit_message() to reencode the output commit: helper methods to reduce redundant blocks of code Conflicts: Documentation/git-commit.txt t/t3415-rebase-autosquash.sh --- 9bec60d3a52fa10b276214f8d255d6ff05a04b77 diff --cc Documentation/git-commit.txt index ec7b577b8,6e4c220f2..b586c0f44 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@@ -9,10 -9,10 +9,10 @@@ SYNOPSI -------- [verse] 'git commit' [-a | --interactive] [-s] [-v] [-u] [--amend] [--dry-run] - [(-c | -C) ] [-F | -m ] [--reset-author] - [--allow-empty] [--allow-empty-message] [--no-verify] [-e] [--author=] - [--date=] [--cleanup=] [--status | --no-status] - [-i | -o] [--] [...] + [(-c | -C | --fixup | --squash) ] [-F | -m ] + [--reset-author] [--allow-empty] [--allow-empty-message] [--no-verify] + [-e] [--author=] [--date=] [--cleanup=] - [--status | --no-status] [--] [[-i | -o ]...] ++ [--status | --no-status] [-i | -o] [--] [...] DESCRIPTION ----------- diff --cc t/t3415-rebase-autosquash.sh index ca16b7037,0028533e0..b38be8e93 --- a/t/t3415-rebase-autosquash.sh +++ b/t/t3415-rebase-autosquash.sh @@@ -94,78 -95,28 +95,102 @@@ test_expect_success 'misspelled auto sq test 0 = $(git rev-list final-missquash...HEAD | wc -l) ' +test_expect_success 'auto squash that matches 2 commits' ' + git reset --hard base && + echo 4 >file4 && + git add file4 && + test_tick && + git commit -m "first new commit" && + echo 1 >file1 && + git add -u && + test_tick && + git commit -m "squash! first" && + git tag final-multisquash && + test_tick && + git rebase --autosquash -i HEAD~4 && + git log --oneline >actual && + test 4 = $(wc -l file1 && + git add -u && + test_tick && + git commit -m "squash! third" && + echo 4 >file4 && + git add file4 && + test_tick && + git commit -m "third commit" && + git tag final-presquash && + test_tick && + git rebase --autosquash -i HEAD~4 && + git log --oneline >actual && + test 5 = $(wc -l file1 && + git add -u && + test_tick && + git commit -m "squash! $(git rev-parse --short HEAD^)" && + git tag final-shasquash && + test_tick && + git rebase --autosquash -i HEAD^^^ && + git log --oneline >actual && + test 3 = $(wc -l file1 && + git add -u && + test_tick && + git commit -m "squash! $(git rev-parse --short=11 HEAD^)" && + git tag final-longshasquash && + test_tick && + git rebase --autosquash -i HEAD^^^ && + git log --oneline >actual && + test 3 = $(wc -l file1 && + git add -u && + test_tick && + git commit --$1 first-commit && + git tag final-commit-$1 && + test_tick && + git rebase --autosquash -i HEAD^^^ && + git log --oneline >actual && + test 3 = $(wc -l