diff options
author | Jon Seymour <jon.seymour@gmail.com> | 2005-06-20 12:29:38 +1000 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-19 20:13:18 -0700 |
commit | 51b1e1713b1ed8e962e994cd0850ea439ad8c3de (patch) | |
tree | 1887c012ec509096a8be45a5bc2c7ea43590eaf9 /rev-list.c | |
parent | eff19d5eccd02341a25f1543ff89fa7351163e3f (diff) | |
download | git-51b1e1713b1ed8e962e994cd0850ea439ad8c3de.tar.gz git-51b1e1713b1ed8e962e994cd0850ea439ad8c3de.tar.xz |
[PATCH] Prevent git-rev-list without --merge-order producing duplicates in output
If b is reachable from a, then:
git-rev-list a b
argument would print one of the commits twice.
This patch fixes that problem. A previous problem fixed it for the
--merge-order switch.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'rev-list.c')
-rw-r--r-- | rev-list.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rev-list.c b/rev-list.c index 6e6a6dfec..897a0e7ad 100644 --- a/rev-list.c +++ b/rev-list.c @@ -5,6 +5,7 @@ #define SEEN (1u << 0) #define INTERESTING (1u << 1) #define COUNTED (1u << 2) +#define SHOWN (LAST_EPOCH_FLAG << 2) static const char rev_list_usage[] = "usage: git-rev-list [OPTION] commit-id <commit-id>\n" @@ -29,6 +30,7 @@ static int show_breaks = 0; static void show_commit(struct commit *commit) { + commit->object.flags |= SHOWN; if (show_breaks) { prefix = "| "; if (commit->object.flags & DISCONTINUITY) { @@ -55,7 +57,7 @@ static void show_commit(struct commit *commit) static int filter_commit(struct commit * commit) { - if (commit->object.flags & UNINTERESTING) + if (commit->object.flags & (UNINTERESTING|SHOWN)) return CONTINUE; if (min_age != -1 && (commit->date > min_age)) return CONTINUE; @@ -63,7 +65,6 @@ static int filter_commit(struct commit * commit) return STOP; if (max_count != -1 && !max_count--) return STOP; - return DO; } |