From bce6286670c6735d0ca2fdf582047e0388dfcd84 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 6 Jul 2005 09:56:16 -0700 Subject: [PATCH] Remove insane overlapping bit ranges from epoch.c ..and move the DUPCHECK to rev-list.c since both the merge-order and the upcoming topo-sort get confused by dups. --- epoch.c | 10 ++-------- epoch.h | 12 ++++++------ rev-list.c | 6 +++++- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/epoch.c b/epoch.c index abfd594bb..7888f1da4 100644 --- a/epoch.c +++ b/epoch.c @@ -582,14 +582,8 @@ int sort_list_in_merge_order(struct commit_list *list, emitter_func emitter) int action = CONTINUE; struct commit_list *reversed = NULL; - for (; list; list = list->next) { - struct commit *next = list->item; - - if (!(next->object.flags & DUPCHECK)) { - next->object.flags |= DUPCHECK; - commit_list_insert(list->item, &reversed); - } - } + for (; list; list = list->next) + commit_list_insert(list->item, &reversed); if (!reversed) return ret; diff --git a/epoch.h b/epoch.h index 0c1385a5d..7493d5a24 100644 --- a/epoch.h +++ b/epoch.h @@ -10,12 +10,12 @@ typedef int (*emitter_func) (struct commit *); int sort_list_in_merge_order(struct commit_list *list, emitter_func emitter); -#define UNINTERESTING (1u<<2) -#define BOUNDARY (1u<<3) -#define VISITED (1u<<4) -#define DISCONTINUITY (1u<<5) -#define DUPCHECK (1u<<6) -#define LAST_EPOCH_FLAG (1u<<6) +/* Low bits are used by rev-list */ +#define UNINTERESTING (1u<<10) +#define BOUNDARY (1u<<11) +#define VISITED (1u<<12) +#define DISCONTINUITY (1u<<13) +#define LAST_EPOCH_FLAG (1u<<14) #endif /* EPOCH_H */ diff --git a/rev-list.c b/rev-list.c index c20fec804..e4d167c00 100644 --- a/rev-list.c +++ b/rev-list.c @@ -8,7 +8,8 @@ #define SEEN (1u << 0) #define INTERESTING (1u << 1) #define COUNTED (1u << 2) -#define SHOWN (LAST_EPOCH_FLAG << 2) +#define SHOWN (1u << 3) +#define DUPCHECK (1u << 4) static const char rev_list_usage[] = "usage: git-rev-list [OPTION] commit-id \n" @@ -485,6 +486,9 @@ int main(int argc, char **argv) commit = get_commit_reference(arg, flags); if (!commit) continue; + if (commit->object.flags & DUPCHECK) + continue; + commit->object.flags |= DUPCHECK; insert(commit, &list); } -- 2.30.2