Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

[PATCH 4/4] cherry-pick/revert: default to topological sorting

From: <hidden>
Date: 2016-06-15 22:54:28
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

From: Martin von Zweigbergk <redacted>

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help