git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: Christian Couder <chriscool@tuxfamily.org>
Subject: [RFC/PATCH] bisect: clean flags after checking merge bases
Date: Thu, 30 Oct 2014 12:01:11 -0700	[thread overview]
Message-ID: <xmqq4mulwfew.fsf@gitster.dls.corp.google.com> (raw)

Unless there is a good reason to belieave that a particular
invocation of a get_merge_bases*() is the last one that cares about
the object flags the computation of merge bases leaves on the
objects, the "cleanup" parameter should always be true, and I do not
think there is one in this codepath.

Found by code inspection.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * I am planning to eventually change the function signature for
   this function to drop "cleanup" and change rare selected
   codepaths that know what they are doing to call a separate
   function that allows the flags not to be cleaned up.  Two calls
   in builtin/merge-base.c are both the last ones that can leave the
   flags on the objects, but I do not think this one, which happens
   before the main traversal even starts, should pass 0 here.

 bisect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bisect.c b/bisect.c
index df09cbc..ccca3b5 100644
--- a/bisect.c
+++ b/bisect.c
@@ -777,7 +777,7 @@ static void check_merge_bases(int no_checkout)
 	int rev_nr;
 	struct commit **rev = get_bad_and_good_commits(&rev_nr);
 
-	result = get_merge_bases_many(rev[0], rev_nr - 1, rev + 1, 0);
+	result = get_merge_bases_many(rev[0], rev_nr - 1, rev + 1, 1);
 
 	for (; result; result = result->next) {
 		const unsigned char *mb = result->item->object.sha1;

             reply	other threads:[~2014-10-30 19:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 19:01 Junio C Hamano [this message]
2014-10-30 19:19 ` [PATCH] get_merge_bases(): always clean-up object flags 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=xmqq4mulwfew.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=chriscool@tuxfamily.org \
    --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).