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

[PATCH] format-patch: use clear_commit_marks() instead of some adhocery

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 27, 2006, 20:38 UTC
Message-ID
<Pine.LNX.4.63.0606272236350.29667@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vr71bh6sv.fsf@assigned-by-dhcp.cox.net>
It is cleaner, and it describes better what is the idea behind the code.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
	On Mon, 26 Jun 2006, Junio C Hamano wrote:
	> I'll be pushing out a new test for format-patch shortly in
	> "next".
	... and this test fails with my original patch: We also need to 
	reset ADDED, and I threw in SHOWN for good measure.
	Maybe there is room for improvement of the revision walker here;
	It smells a little like ADDED is not only used to avoid duplicate
	parsing (which I guess is now happening, even with
	reset_all_objects_flags() instead of clear_commit_marks()), but
	also to decide if the revision walker should walk on.
	We are getting more and more users of the revision walker, and this
	is just the first to call the walker more than once.
 builtin-log.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 4ee5891..f9515a8 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -160,15 +160,6 @@ static void reopen_stdout(struct commit 
 	freopen(filename, "w", stdout);
 }
 
-static void reset_all_objects_flags()
-{
-	int i;
-
-	for (i = 0; i < obj_allocs; i++)
-		if (objs[i])
-			objs[i]->flags = 0;
-}
-
 static int get_patch_id(struct commit *commit, struct diff_options *options,
 		unsigned char *sha1)
 {
@@ -220,7 +211,10 @@ static void get_patch_ids(struct rev_inf
 	}
 
 	/* reset for next revision walk */
-	reset_all_objects_flags();
+	clear_commit_marks((struct commit *)o1,
+			SEEN | UNINTERESTING | SHOWN | ADDED);
+	clear_commit_marks((struct commit *)o2,
+			SEEN | UNINTERESTING | SHOWN | ADDED);
 	o1->flags = flags1;
 	o2->flags = flags2;
 }
-- 
1.4.1.rc1.g9de8f-dirty
Previous: Johannes Schindelin
Message 20 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.