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

Re: [PATCH 3/2] format-patch: use clear_commit_marks() instead of some adhocery

From
Junio C Hamano <junkio@cox.net>
Date
Jun 26, 2006, 16:09 UTC
Message-ID
<7vhd27j3v8.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0606261728340.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 	It is not clean to reset the flags of all objects to 0. Instead, 
> 	the commits are walked directly. Not that it matters in that
> 	particular case (the only read objects _are_ these commits).

I think this makes sense, but the clear-commit-marks function itself looks fishy. I suspect a parent that has not been parsed could be already marked in which case the current code would leave it marked. Don't we need this perhaps?

diff --git a/commit.c b/commit.c
index 946615d..69fbc41 100644
--- a/commit.c
+++ b/commit.c
@@ -397,8 +397,7 @@ void clear_commit_marks(struct commit *c
 	commit->object.flags &= ~mark;
 	while (parents) {
 		struct commit *parent = parents->item;
-		if (parent && parent->object.parsed &&
-		    (parent->object.flags & mark))
+		if (parent && (parent->object.flags & mark))
 			clear_commit_marks(parent, mark);
 		parents = parents->next;
 	}
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 of 20 in “resurrect format-patch's patch id checking”
  1. 0/2 resurrect format-patch's patch id checkingJohannes Schindelin, Jun 25, 2006
  2. 3/2 format-patch: use clear_commit_marks() instead of some adhoceryJohannes Schindelin, Jun 26, 2006
  3. Junio C HamanoJun 26, 2006
  4. Johannes SchindelinJun 26, 2006
  5. Martin LanghoffJun 26, 2006
  6. Johannes SchindelinJun 26, 2006
  7. Martin LanghoffJun 26, 2006
  8. Johannes SchindelinJun 26, 2006
  9. Junio C HamanoJun 26, 2006
  10. format-patch: support really old non-range syntax, with a warningJohannes Schindelin, Jun 26, 2006
  11. Martin Langhoff (CatalystIT)Jun 26, 2006
  12. Johannes SchindelinJun 26, 2006
  13. Johannes SchindelinJun 27, 2006
  14. Martin LanghoffJun 27, 2006
  15. Johannes SchindelinJun 27, 2006
  16. Martin LanghoffJun 27, 2006
  17. Johannes SchindelinJun 27, 2006
  18. Junio C HamanoJun 26, 2006
  19. Johannes SchindelinJun 26, 2006
  20. format-patch: use clear_commit_marks() instead of some adhoceryJohannes Schindelin, Jun 27, 2006

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.