Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15
DORMANTno replies

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 2/2] log: remove redundant check for merge commit

From: Martin von Zweigbergk <hidden>
Date: 2016-06-15 22:54:21
Subsystem: the rest · Maintainer: Linus Torvalds

While walking the revision list in get_patch_ids and cmd_cherry, we
ignore merges by checking if there is more than one parent. However,
since the revision walk was initialized with revs.ignore_merges = 1,
this would never happen. Remove the unnecessary checks.

Also re-initializing rev_info fields to the same values already set in
init_revisions().

Signed-off-by: Martin von Zweigbergk <redacted>
---
 builtin/log.c | 10 ----------
 1 file changed, 10 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index 7a92e3f..8182a18 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -726,10 +726,6 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids)
 		die(_("revision walk setup failed"));
 
 	while ((commit = get_revision(&check_rev)) != NULL) {
-		/* ignore merges */
-		if (commit->parents && commit->parents->next)
-			continue;
-
 		add_commit_patch_id(commit, ids);
 	}
 
@@ -1509,8 +1505,6 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 
 	init_revisions(&revs, prefix);
 	revs.diff = 1;
-	revs.combine_merges = 0;
-	revs.ignore_merges = 1;
 	DIFF_OPT_SET(&revs.diffopt, RECURSIVE);
 
 	if (add_pending_commit(head, &revs, 0))
@@ -1534,10 +1528,6 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 	if (prepare_revision_walk(&revs))
 		die(_("revision walk setup failed"));
 	while ((commit = get_revision(&revs)) != NULL) {
-		/* ignore merges */
-		if (commit->parents && commit->parents->next)
-			continue;
-
 		commit_list_insert(commit, &list);
 	}
 
-- 
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