git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: git@vger.kernel.org
Cc: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Subject: [PATCH 2/2] log: remove redundant check for merge commit
Date: Fri, 27 Jul 2012 10:21:39 -0700	[thread overview]
Message-ID: <1343409699-27199-3-git-send-email-martin.von.zweigbergk@gmail.com> (raw)
In-Reply-To: <1343409699-27199-1-git-send-email-martin.von.zweigbergk@gmail.com>

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 <martin.von.zweigbergk@gmail.com>
---
 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

  parent reply	other threads:[~2012-07-27 17:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-27 17:21 [PATCH 0/2] Small log simplifications Martin von Zweigbergk
2012-07-27 17:21 ` [PATCH 1/2] remove unnecessary parameter from get_patch_ids() Martin von Zweigbergk
2012-07-27 22:44   ` Junio C Hamano
2012-07-28  1:54     ` Martin von Zweigbergk
2012-07-27 17:21 ` Martin von Zweigbergk [this message]
2012-07-27 22:30   ` [PATCH 2/2] log: remove redundant check for merge commit Junio C Hamano
2012-07-28  4:52     ` Martin von Zweigbergk
2012-07-28  5:58       ` Junio C Hamano
     [not found]         ` <7vzk6kwf6l.fsf@alter.siamese.dyndns.org>
     [not found]           ` <CAOeW2eG4mKTWm7PEGF_t0F9c_X1gkQaDw7HSrCiZaDte7PvOdQ@mail.gmail.com>
2012-07-29  4:57             ` Martin von Zweigbergk
2012-07-29  6:24               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343409699-27199-3-git-send-email-martin.von.zweigbergk@gmail.com \
    --to=martin.von.zweigbergk@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).