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

Subsystems: the rest

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:31

Johannes Schindelin [off-list ref] 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;
 	}

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

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:31

Hi,

On Mon, 26 Jun 2006, Junio C Hamano wrote:
quoted hunk
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))
This is probably not necessary for existing users, but it's a good change 
for the future: new users might be surprised to learn that there are 
unparsed objects, which still want to be handled.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help