login
Header Space

 
 

Re: [PATCH 4/3] Fold get_merge_bases_clean() into get_merge_bases()

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Rene Scharfe <rene.scharfe@...>
Cc: Linus Torvalds <torvalds@...>, <git@...>, Johannes Schindelin <Johannes.Schindelin@...>
Date: Sunday, July 2, 2006 - 2:28 pm

Rene Scharfe <rene.scharfe@lsrfire.ath.cx> writes:


Gaah.  commit.c defines its own UNINTERESTING and you rely on
not including revision.h which is ... gasp ... #$@#$!!!

Could we do something like this, pretty please?

---
diff --git a/commit.c b/commit.c
index 94c1d0e..a608faf 100644
--- a/commit.c
+++ b/commit.c
@@ -851,14 +851,14 @@ void sort_in_topological_order_fn(struct
 /* bits #0..7 in revision.h */
 #define PARENT1		(1u<< 8)
 #define PARENT2		(1u<< 9)
-#define UNINTERESTING	(1u<<10)
+#define STALE		(1u<<10)
 
 static struct commit *interesting(struct commit_list *list)
 {
 	while (list) {
 		struct commit *commit = list->item;
 		list = list->next;
-		if (commit->object.flags & UNINTERESTING)
+		if (commit->object.flags & STALE)
 			continue;
 		return commit;
 	}
@@ -920,17 +920,17 @@ static struct commit *interesting(struct
  *
  * Next, we pop B and something very interesting happens.  It has flags==3
  * so it is also placed on the result list, and its parents are marked
- * uninteresting, retroactively, and placed back on the list:
+ * stale, retroactively, and placed back on the list:
  *
  *    list=C(7), result=C(7) B(3)
  *
  * Now, list does not have any interesting commit.  So we find the newest
- * commit from the result list that is not marked uninteresting.  Which is
+ * commit from the result list that is not marked stale.  Which is
  * commit B.
  *
  *
  * Another pathological example how this thing used to fail to mark an
- * ancestor of a merge base as UNINTERESTING before we introduced the
+ * ancestor of a merge base as STALE before we introduced the
  * postprocessing phase (mark_reachable_commits).
  *
  *		  2
@@ -960,8 +960,8 @@ static struct commit *interesting(struct
  *	 C7			2 3 7 1 3 2 1 2
  *
  * At this point, unfortunately, everybody in the list is
- * uninteresting, so we fail to complete the following two
- * steps to fully marking uninteresting commits.
+ * stale, so we fail to complete the following two
+ * steps to fully marking stale commits.
  *
  *	 D7			2 3 7 7 3 2 1 2
  *	 E7			2 3 7 7 7 2 1 2
@@ -981,10 +981,10 @@ static void mark_reachable_commits(struc
 	 */
 	for (tmp = result; tmp; tmp = tmp->next) {
 		struct commit *c = tmp->item;
-		/* Reinject uninteresting ones to list,
+		/* Reinject stale ones to list,
 		 * so we can scan their parents.
 		 */
-		if (c->object.flags & UNINTERESTING)
+		if (c->object.flags & STALE)
 			commit_list_insert(c, &list);
 	}
 	while (list) {
@@ -995,8 +995,8 @@ static void mark_reachable_commits(struc
 		list = list->next;
 		free(tmp);
 
-		/* Anything taken out of the list is uninteresting, so
-		 * mark all its parents uninteresting.  We do not
+		/* Anything taken out of the list is stale, so
+		 * mark all its parents stale.  We do not
 		 * parse new ones (we already parsed all the relevant
 		 * ones).
 		 */
@@ -1004,8 +1004,8 @@ static void mark_reachable_commits(struc
 		while (parents) {
 			struct commit *p = parents->item;
 			parents = parents->next;
-			if (!(p->object.flags & UNINTERESTING)) {
-				p->object.flags |= UNINTERESTING;
+			if (!(p->object.flags & STALE)) {
+				p->object.flags |= STALE;
 				commit_list_insert(p, &list);
 			}
 		}
@@ -1034,7 +1034,7 @@ struct commit_list *get_merge_bases(stru
 		struct commit *commit = list->item;
 		struct commit_list *parents;
 		int flags = commit->object.flags
-			& (PARENT1 | PARENT2 | UNINTERESTING);
+			& (PARENT1 | PARENT2 | STALE);
 
 		tmp = list;
 		list = list->next;
@@ -1042,8 +1042,8 @@ struct commit_list *get_merge_bases(stru
 		if (flags == (PARENT1 | PARENT2)) {
 			insert_by_date(commit, &result);
 
-			/* Mark parents of a found merge uninteresting */
-			flags |= UNINTERESTING;
+			/* Mark parents of a found merge stale */
+			flags |= STALE;
 		}
 		parents = commit->parents;
 		while (parents) {
@@ -1067,7 +1067,7 @@ struct commit_list *get_merge_bases(stru
 	for (tmp = result, list = NULL; tmp; ) {
 		struct commit *commit = tmp->item;
 		struct commit_list *next = tmp->next;
-		if (commit->object.flags & UNINTERESTING) {
+		if (commit->object.flags & STALE) {
 			if (list != NULL)
 				list->next = next;
 			free(tmp);
@@ -1075,15 +1075,15 @@ struct commit_list *get_merge_bases(stru
 			if (list == NULL)
 				result = tmp;
 			list = tmp;
-			commit->object.flags |= UNINTERESTING;
+			commit->object.flags |= STALE;
 		}
 
 		tmp = next;
 	}
 
 	if (cleanup) {
-		clear_commit_marks(rev1, PARENT1 | PARENT2 | UNINTERESTING);
-		clear_commit_marks(rev2, PARENT1 | PARENT2 | UNINTERESTING);
+		clear_commit_marks(rev1, PARENT1 | PARENT2 | STALE);
+		clear_commit_marks(rev2, PARENT1 | PARENT2 | STALE);
 	}
 
 	return result;

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
A note on merging conflicts.., Linus Torvalds, (Fri Jun 30, 10:44 pm)
Re: A note on merging conflicts.., Junio C Hamano, (Fri Jun 30, 11:08 pm)
Re: A note on merging conflicts.., Linus Torvalds, (Fri Jun 30, 11:54 pm)
Re: A note on merging conflicts.., Rene Scharfe, (Sat Jul 1, 11:09 am)
Re: A note on merging conflicts.., Junio C Hamano, (Sat Jul 1, 2:37 pm)
Re: A note on merging conflicts.., Rene Scharfe, (Sat Jul 1, 3:29 pm)
Re: A note on merging conflicts.., Linus Torvalds, (Sat Jul 1, 4:04 pm)
Re: A note on merging conflicts.., Junio C Hamano, (Sat Jul 1, 4:07 pm)
Re: A note on merging conflicts.., Junio C Hamano, (Sat Jul 1, 4:14 pm)
Re: [PATCH 4/3] Fold get_merge_bases_clean() into get_merge_..., Junio C Hamano, (Sun Jul 2, 2:28 pm)
Re: [PATCH 4/3] Fold get_merge_bases_clean() into get_merge_..., Johannes Schindelin, (Sun Jul 2, 5:56 am)
[PATCH 3/3] Make clear_commit_marks() clean harder, Rene Scharfe, (Sat Jul 1, 7:29 pm)
Re: [PATCH 3/3] Make clear_commit_marks() clean harder, Junio C Hamano, (Mon Jul 3, 5:32 am)
Re: [PATCH 3/3] Make clear_commit_marks() clean harder, Johannes Schindelin, (Mon Jul 3, 9:56 am)
Re: [PATCH 3/3] Make clear_commit_marks() clean harder, Junio C Hamano, (Mon Jul 3, 3:47 pm)
Re: [PATCH 3/3] Make clear_commit_marks() clean harder, Johannes Schindelin, (Mon Jul 3, 5:12 pm)
Re: [PATCH 3/3] Make clear_commit_marks() clean harder, Linus Torvalds, (Mon Jul 3, 6:55 pm)
Re: [PATCH 3/3] Make clear_commit_marks() clean harder, Johannes Schindelin, (Tue Jul 4, 3:53 am)
Re: [PATCH 3/3] Make clear_commit_marks() clean harder, Junio C Hamano, (Tue Jul 4, 4:20 am)
Re: [PATCH 3/3] Make clear_commit_marks() clean harder, Linus Torvalds, (Mon Jul 3, 1:05 pm)
Re: [PATCH 3/3] Make clear_commit_marks() clean harder, Johannes Schindelin, (Mon Jul 3, 5:08 pm)
[PATCH 2/3] Add '...' operator for revisions, Rene Scharfe, (Sat Jul 1, 7:29 pm)
[PATCH 1/3] Add get_merge_bases_clean(), Rene Scharfe, (Sat Jul 1, 7:29 pm)
Re: [PATCH 1/3] Add get_merge_bases_clean(), Johannes Schindelin, (Sat Jul 1, 7:43 pm)
Re: A note on merging conflicts.., Junio C Hamano, (Sat Jul 1, 3:56 pm)
Re: A note on merging conflicts.., Johannes Schindelin, (Sat Jul 1, 7:01 pm)
Re: A note on merging conflicts.., J. Bruce Fields, (Sat Jul 1, 2:01 pm)
Re: A note on merging conflicts.., Linus Torvalds, (Sat Jul 1, 2:20 pm)
Re: A note on merging conflicts.., Daniel Barkalow, (Sat Jul 1, 6:24 pm)
Re: A note on merging conflicts.., Linus Torvalds, (Sat Jul 1, 6:57 pm)
Re: A note on merging conflicts.., Daniel Barkalow, (Sat Jul 1, 7:25 pm)
Re: A note on merging conflicts.., Linus Torvalds, (Sat Jul 1, 8:08 pm)
Re: A note on merging conflicts.., Daniel Barkalow, (Sat Jul 1, 7:45 pm)
Re: A note on merging conflicts.., Rene Scharfe, (Sun Jul 2, 7:31 am)
Re: A note on merging conflicts.., Daniel Barkalow, (Sun Jul 2, 5:42 pm)
Re: A note on merging conflicts.., Linus Torvalds, (Sat Jul 1, 12:25 pm)
Re: A note on merging conflicts.., Rene Scharfe, (Sat Jul 1, 2:13 pm)
Re: A note on merging conflicts.., Johannes Schindelin, (Sat Jul 1, 11:23 am)
Re: A note on merging conflicts.., Linus Torvalds, (Fri Jun 30, 11:59 pm)
speck-geostationary