@matheusbsbs / matheus-bagliano / commits / 542ccefe89
Fork 0

commit.c: do not redefine UNINTERESTING bit.

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Jul 2, 2006 at 11:34 UTC 542ccefe896a8960a6ce0b0ba4519537649ae29a
1 file changed +20 -20
commit.c
+20 -20
@@ -851,14 +851,14 @@ void sort_in_topological_order_fn(struct commit_list ** list, int lifo,
851 /* bits #0..7 in revision.h */
852 #define PARENT1 (1u<< 8)
853 #define PARENT2 (1u<< 9)
854 -#define UNINTERESTING (1u<<10)
854 +#define STALE (1u<<10)
855
856 static struct commit *interesting(struct commit_list *list)
857 {
858 while (list) {
859 struct commit *commit = list->item;
860 list = list->next;
861 - if (commit->object.flags & UNINTERESTING)
861 + if (commit->object.flags & STALE)
862 continue;
863 return commit;
864 }
@@ -920,17 +920,17 @@ static struct commit *interesting(struct commit_list *list)
920 *
921 * Next, we pop B and something very interesting happens. It has flags==3
922 * so it is also placed on the result list, and its parents are marked
923 - * uninteresting, retroactively, and placed back on the list:
923 + * stale, retroactively, and placed back on the list:
924 *
925 * list=C(7), result=C(7) B(3)
926 *
927 * Now, list does not have any interesting commit. So we find the newest
928 - * commit from the result list that is not marked uninteresting. Which is
928 + * commit from the result list that is not marked stale. Which is
929 * commit B.
930 *
931 *
932 * Another pathological example how this thing used to fail to mark an
933 - * ancestor of a merge base as UNINTERESTING before we introduced the
933 + * ancestor of a merge base as STALE before we introduced the
934 * postprocessing phase (mark_reachable_commits).
935 *
936 * 2
@@ -960,8 +960,8 @@ static struct commit *interesting(struct commit_list *list)
960 * C7 2 3 7 1 3 2 1 2
961 *
962 * At this point, unfortunately, everybody in the list is
963 - * uninteresting, so we fail to complete the following two
964 - * steps to fully marking uninteresting commits.
963 + * stale, so we fail to complete the following two
964 + * steps to fully marking stale commits.
965 *
966 * D7 2 3 7 7 3 2 1 2
967 * E7 2 3 7 7 7 2 1 2
@@ -981,10 +981,10 @@ static void mark_reachable_commits(struct commit_list *result,
981 */
982 for (tmp = result; tmp; tmp = tmp->next) {
983 struct commit *c = tmp->item;
984 - /* Reinject uninteresting ones to list,
984 + /* Reinject stale ones to list,
985 * so we can scan their parents.
986 */
987 - if (c->object.flags & UNINTERESTING)
987 + if (c->object.flags & STALE)
988 commit_list_insert(c, &list);
989 }
990 while (list) {
@@ -995,8 +995,8 @@ static void mark_reachable_commits(struct commit_list *result,
995 list = list->next;
996 free(tmp);
997
998 - /* Anything taken out of the list is uninteresting, so
999 - * mark all its parents uninteresting. We do not
998 + /* Anything taken out of the list is stale, so
999 + * mark all its parents stale. We do not
1000 * parse new ones (we already parsed all the relevant
1001 * ones).
1002 */
@@ -1004,8 +1004,8 @@ static void mark_reachable_commits(struct commit_list *result,
1004 while (parents) {
1005 struct commit *p = parents->item;
1006 parents = parents->next;
1007 - if (!(p->object.flags & UNINTERESTING)) {
1008 - p->object.flags |= UNINTERESTING;
1007 + if (!(p->object.flags & STALE)) {
1008 + p->object.flags |= STALE;
1009 commit_list_insert(p, &list);
1010 }
1011 }
@@ -1034,7 +1034,7 @@ struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2,
1034 struct commit *commit = list->item;
1035 struct commit_list *parents;
1036 int flags = commit->object.flags
1037 - & (PARENT1 | PARENT2 | UNINTERESTING);
1037 + & (PARENT1 | PARENT2 | STALE);
1038
1039 tmp = list;
1040 list = list->next;
@@ -1042,8 +1042,8 @@ struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2,
1042 if (flags == (PARENT1 | PARENT2)) {
1043 insert_by_date(commit, &result);
1044
1045 - /* Mark parents of a found merge uninteresting */
1046 - flags |= UNINTERESTING;
1045 + /* Mark parents of a found merge stale */
1046 + flags |= STALE;
1047 }
1048 parents = commit->parents;
1049 while (parents) {
@@ -1067,7 +1067,7 @@ struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2,
1067 for (tmp = result, list = NULL; tmp; ) {
1068 struct commit *commit = tmp->item;
1069 struct commit_list *next = tmp->next;
1070 - if (commit->object.flags & UNINTERESTING) {
1070 + if (commit->object.flags & STALE) {
1071 if (list != NULL)
1072 list->next = next;
1073 free(tmp);
@@ -1075,15 +1075,15 @@ struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2,
1075 if (list == NULL)
1076 result = tmp;
1077 list = tmp;
1078 - commit->object.flags |= UNINTERESTING;
1078 + commit->object.flags |= STALE;
1079 }
1080
1081 tmp = next;
1082 }
1083
1084 if (cleanup) {
1085 - clear_commit_marks(rev1, PARENT1 | PARENT2 | UNINTERESTING);
1086 - clear_commit_marks(rev2, PARENT1 | PARENT2 | UNINTERESTING);
1085 + clear_commit_marks(rev1, PARENT1 | PARENT2 | STALE);
1086 + clear_commit_marks(rev2, PARENT1 | PARENT2 | STALE);
1087 }
1088
1089 return result;