git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATCH] bisect: clean flags after checking merge bases

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 30, 2014, 19:01 UTC
Message-ID
<xmqq4mulwfew.fsf@gitster.dls.corp.google.com>

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;
Next: Junio C Hamano
Message 1 of 2 in “bisect: clean flags after checking merge bases”
  1. bisect: clean flags after checking merge basesJunio C Hamano, Oct 30, 2014
  2. get_merge_bases(): always clean-up object flagsJunio C Hamano, Oct 30, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.