diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-09-10 15:42:54 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-10 15:42:55 -0700 |
commit | c2b927932d90588e7094100b470b9e94bd769afe (patch) | |
tree | ca85ef0330ea4906103141855f79914710b52463 /t | |
parent | Merge branch 'jk/maint-quiet-is-synonym-to-s-in-log' (diff) | |
parent | cherry-pick/revert: respect order of revisions to pick (diff) | |
download | tgif-c2b927932d90588e7094100b470b9e94bd769afe.tar.xz |
Merge branch 'mz/cherry-pick-cmdline-order'
"git cherry-pick A C B" used to replay changes in A and then B and
then C if these three commits had committer timestamps in that
order, which is not what the user who said "A C B" naturally expects.
* mz/cherry-pick-cmdline-order:
cherry-pick/revert: respect order of revisions to pick
demonstrate broken 'git cherry-pick three one two'
teach log --no-walk=unsorted, which avoids sorting
Diffstat (limited to 't')
-rwxr-xr-x | t/t3508-cherry-pick-many-commits.sh | 15 | ||||
-rwxr-xr-x | t/t4202-log.sh | 10 |
2 files changed, 25 insertions, 0 deletions
diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh index 75f7ff4f2f..340afc760d 100755 --- a/t/t3508-cherry-pick-many-commits.sh +++ b/t/t3508-cherry-pick-many-commits.sh @@ -44,6 +44,21 @@ test_expect_success 'cherry-pick first..fourth works' ' check_head_differs_from fourth ' +test_expect_success 'cherry-pick three one two works' ' + git checkout -f first && + test_commit one && + test_commit two && + test_commit three && + git checkout -f master && + git reset --hard first && + git cherry-pick three one two && + git diff --quiet three && + git diff --quiet HEAD three && + test "$(git log --reverse --format=%s first..)" = "three +one +two" +' + test_expect_success 'output to keep user entertained during multi-pick' ' cat <<-\EOF >expected && [master OBJID] second diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 0baaad2a24..924ba536ca 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -178,11 +178,21 @@ test_expect_success 'git log --no-walk <commits> sorts by commit time' ' test_cmp expect actual ' +test_expect_success 'git log --no-walk=sorted <commits> sorts by commit time' ' + git log --no-walk=sorted --oneline 5d31159 804a787 394ef78 > actual && + test_cmp expect actual +' + cat > expect << EOF 5d31159 fourth 804a787 sixth 394ef78 fifth EOF +test_expect_success 'git log --no-walk=unsorted <commits> leaves list of commits as given' ' + git log --no-walk=unsorted --oneline 5d31159 804a787 394ef78 > actual && + test_cmp expect actual +' + test_expect_success 'git show <commits> leaves list of commits as given' ' git show --oneline -s 5d31159 804a787 394ef78 > actual && test_cmp expect actual |