summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-09-10 15:42:54 -0700
committerJunio C Hamano <gitster@pobox.com>2012-09-10 15:42:55 -0700
commitc2b927932d90588e7094100b470b9e94bd769afe (patch)
treeca85ef0330ea4906103141855f79914710b52463 /sequencer.c
parent1c0712dea8fd927faa49fe494f507d18f0d41264 (diff)
parenta73e22e96350c9bcb5c0e31e0298ce67bec0a527 (diff)
downloadgit-c2b927932d90588e7094100b470b9e94bd769afe.tar.gz
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 'sequencer.c')
-rw-r--r--sequencer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c
index 1ea5293f6e..f86f116a15 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -546,7 +546,11 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
static void prepare_revs(struct replay_opts *opts)
{
- if (opts->action != REPLAY_REVERT)
+ /*
+ * picking (but not reverting) ranges (but not individual revisions)
+ * should be done in reverse
+ */
+ if (opts->action == REPLAY_PICK && !opts->revs->no_walk)
opts->revs->reverse ^= 1;
if (prepare_revision_walk(opts->revs))