From: Lars Hjemli <hjemli@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: <nanako3@bluebottle.com>, "Stephen R. van den Berg" <srb@cuci.nl>,
git@vger.kernel.org
Subject: [PATCH] revision.c: really honor --first-parent
Date: Mon, 12 May 2008 01:14:11 +0200 [thread overview]
Message-ID: <1210547651-32510-1-git-send-email-hjemli@gmail.com> (raw)
In-Reply-To: <7vd4ns3cll.fsf@gitster.siamese.dyndns.org>
In add_parents_to_list, if any parent of a revision had already been
SEEN, the current code would continue with the next parent. But if the
first parent has been SEEN and --first-parent has been specified we need
to break, not continue.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
---
revision.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/revision.c b/revision.c
index 44d780b..974ad10 100644
--- a/revision.c
+++ b/revision.c
@@ -468,8 +468,11 @@ static int add_parents_to_list(struct rev_info *revs, struct commit *commit, str
if (parse_commit(p) < 0)
return -1;
p->object.flags |= left_flag;
- if (p->object.flags & SEEN)
+ if (p->object.flags & SEEN) {
+ if (revs->first_parent_only)
+ break;
continue;
+ }
p->object.flags |= SEEN;
insert_by_date(p, list);
if(revs->first_parent_only)
--
1.5.5.1.148.g8ee22.dirty
next prev parent reply other threads:[~2008-05-11 23:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-11 7:03 "git log --first-parent" shows parents that are not first しらいしななこ
2008-05-11 18:44 ` Junio C Hamano
2008-05-11 23:14 ` Lars Hjemli [this message]
2008-05-12 15:12 ` [PATCH v2] revision.c: really honor --first-parent Lars Hjemli
2008-05-13 20:15 ` Stephen R. van den Berg
2008-05-13 20:43 ` Lars Hjemli
2008-05-13 22:38 ` Junio C Hamano
2008-05-14 10:34 ` Stephen R. van den Berg
2008-05-14 10:54 ` Lars Hjemli
2008-05-14 11:10 ` Stephen R. van den Berg
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=1210547651-32510-1-git-send-email-hjemli@gmail.com \
--to=hjemli@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nanako3@bluebottle.com \
--cc=srb@cuci.nl \
/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;
as well as URLs for NNTP newsgroup(s).