From: Jon Seymour <jon.seymour@gmail.com>
To: git@vger.kernel.org
Cc: torvalds@osdl.org, jon.seymour@gmail.com, paulus@samba.org
Subject: [PATCH 6/7] Prevent git-rev-list without --merge-order producing duplicates in output
Date: Mon, 20 Jun 2005 12:29:38 +1000 [thread overview]
Message-ID: <20050620022938.28641.qmail@blackcubes.dyndns.org> (raw)
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>
---
epoch.h | 13 +++++++------
rev-list.c | 5 +++--
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/epoch.h b/epoch.h
--- a/epoch.h
+++ b/epoch.h
@@ -10,11 +10,12 @@ typedef int (*emitter_func) (struct comm
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 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)
-#endif /* EPOCH_H */
+#endif /* EPOCH_H */
diff --git a/rev-list.c b/rev-list.c
--- 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 *c
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 *
return STOP;
if (max_count != -1 && !max_count--)
return STOP;
-
return DO;
}
------------
reply other threads:[~2005-06-20 2:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050620022938.28641.qmail@blackcubes.dyndns.org \
--to=jon.seymour@gmail.com \
--cc=git@vger.kernel.org \
--cc=paulus@samba.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox