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 v2] revision.c: really honor --first-parent
Date: Mon, 12 May 2008 17:12:36 +0200 [thread overview]
Message-ID: <1210605156-22926-1-git-send-email-hjemli@gmail.com> (raw)
In-Reply-To: <1210547651-32510-1-git-send-email-hjemli@gmail.com>
In add_parents_to_list, if any parent of a revision had already been
SEEN, the current code would continue with the next parent, skipping
the test for --first-parent. This patch inverts the test for SEEN so
that the test for --first-parent is always performed.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
---
This is a slightly different approach which I think is less ugly.
revision.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/revision.c b/revision.c
index 44d780b..2fc26b8 100644
--- a/revision.c
+++ b/revision.c
@@ -468,10 +468,10 @@ 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)
- continue;
- p->object.flags |= SEEN;
- insert_by_date(p, list);
+ if (!(p->object.flags & SEEN)) {
+ p->object.flags |= SEEN;
+ insert_by_date(p, list);
+ }
if(revs->first_parent_only)
break;
}
--
1.5.5.1.148.g8ee22.dirty
next prev parent reply other threads:[~2008-05-12 15:11 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 ` [PATCH] revision.c: really honor --first-parent Lars Hjemli
2008-05-12 15:12 ` Lars Hjemli [this message]
2008-05-13 20:15 ` [PATCH v2] " 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=1210605156-22926-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.