mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
[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>
This commit is contained in:
parent
eff19d5ecc
commit
51b1e1713b
13
epoch.h
13
epoch.h
|
@ -10,11 +10,12 @@ typedef int (*emitter_func) (struct commit *);
|
||||||
|
|
||||||
int sort_list_in_merge_order(struct commit_list *list, emitter_func emitter);
|
int sort_list_in_merge_order(struct commit_list *list, emitter_func emitter);
|
||||||
|
|
||||||
#define UNINTERESTING (1u<<2)
|
#define UNINTERESTING (1u<<2)
|
||||||
#define BOUNDARY (1u<<3)
|
#define BOUNDARY (1u<<3)
|
||||||
#define VISITED (1u<<4)
|
#define VISITED (1u<<4)
|
||||||
#define DISCONTINUITY (1u<<5)
|
#define DISCONTINUITY (1u<<5)
|
||||||
#define DUPCHECK (1u<<6)
|
#define DUPCHECK (1u<<6)
|
||||||
|
#define LAST_EPOCH_FLAG (1u<<6)
|
||||||
|
|
||||||
|
|
||||||
#endif /* EPOCH_H */
|
#endif /* EPOCH_H */
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#define SEEN (1u << 0)
|
#define SEEN (1u << 0)
|
||||||
#define INTERESTING (1u << 1)
|
#define INTERESTING (1u << 1)
|
||||||
#define COUNTED (1u << 2)
|
#define COUNTED (1u << 2)
|
||||||
|
#define SHOWN (LAST_EPOCH_FLAG << 2)
|
||||||
|
|
||||||
static const char rev_list_usage[] =
|
static const char rev_list_usage[] =
|
||||||
"usage: git-rev-list [OPTION] commit-id <commit-id>\n"
|
"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)
|
static void show_commit(struct commit *commit)
|
||||||
{
|
{
|
||||||
|
commit->object.flags |= SHOWN;
|
||||||
if (show_breaks) {
|
if (show_breaks) {
|
||||||
prefix = "| ";
|
prefix = "| ";
|
||||||
if (commit->object.flags & DISCONTINUITY) {
|
if (commit->object.flags & DISCONTINUITY) {
|
||||||
|
@ -55,7 +57,7 @@ static void show_commit(struct commit *commit)
|
||||||
|
|
||||||
static int filter_commit(struct commit * commit)
|
static int filter_commit(struct commit * commit)
|
||||||
{
|
{
|
||||||
if (commit->object.flags & UNINTERESTING)
|
if (commit->object.flags & (UNINTERESTING|SHOWN))
|
||||||
return CONTINUE;
|
return CONTINUE;
|
||||||
if (min_age != -1 && (commit->date > min_age))
|
if (min_age != -1 && (commit->date > min_age))
|
||||||
return CONTINUE;
|
return CONTINUE;
|
||||||
|
@ -63,7 +65,6 @@ static int filter_commit(struct commit * commit)
|
||||||
return STOP;
|
return STOP;
|
||||||
if (max_count != -1 && !max_count--)
|
if (max_count != -1 && !max_count--)
|
||||||
return STOP;
|
return STOP;
|
||||||
|
|
||||||
return DO;
|
return DO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue