[PATCH 4/4] cherry-pick/revert: default to topological sorting
- From
- y@google.com <y@google.com>
- Date
- Aug 13, 2012, 06:27 UTC
- Message-ID
- <50289e51.29d0320a.65ff.2c48SMTPIN_ADDED@gmr-mx.google.com>
- In-Reply-To
- <1344839240-17402-1-git-send-email-y>
From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
When 'git cherry-pick' and 'git revert' are used with ranges such as 'git cherry-pick A..B', the order of the commits to pick are determined by the default date-based sorting. If a commit has a commit date before the commit date of its parent, it will therfore be applied before its parent. In the context of cherry-pick/revert, this is most likely not what the user expected, so let's enable topological sorting by default.
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> --- builtin/revert.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/builtin/revert.c b/builtin/revert.c index 98ad641..6880ce5 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -194,6 +194,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts) opts->revs = xmalloc(sizeof(*opts->revs)); init_revisions(opts->revs, NULL); opts->revs->no_walk = REVISION_WALK_NO_WALK_UNSORTED; + opts->revs->topo_order = 1; if (argc < 2) usage_with_options(usage_str, options); memset(&s_r_opt, 0, sizeof(s_r_opt));
-- 1.7.11.1.104.ge7b44f1