[PATCH 3/4] cherry-pick/revert: respect order of revisions to pick
- From
- y@google.com <y@google.com>
- Date
- Aug 13, 2012, 06:27 UTC
- Message-ID
- <50289e51.29d0320a.65ff.2c47SMTPIN_ADDED@gmr-mx.google.com>
- In-Reply-To
- <1344839240-17402-1-git-send-email-y>
From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
'git cherry-pick A B' implicitly sends --no-walk=sorted to the revision walker, which means that the older of A and B will be applied first, which is most likely surprising to most. Fix this by instead sending --no-walk=unsorted to the revision walker.
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> ---
This has actually been reported before, in http://thread.gmane.org/gmane.comp.version-control.git/164794/focus=164807, where I apparently replied myself. Incidentally, it seems like the unrelated bug in 'git show' I reported in that thread is the one that Junio mentioned got fixed recently.
builtin/revert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/revert.c b/builtin/revert.c index 42ce399..98ad641 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -193,7 +193,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts) struct setup_revision_opt s_r_opt; opts->revs = xmalloc(sizeof(*opts->revs)); init_revisions(opts->revs, NULL); - opts->revs->no_walk = REVISION_WALK_NO_WALK_SORTED; + opts->revs->no_walk = REVISION_WALK_NO_WALK_UNSORTED; if (argc < 2) usage_with_options(usage_str, options); memset(&s_r_opt, 0, sizeof(s_r_opt));
-- 1.7.11.1.104.ge7b44f1