From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Francis Moreau <francis.moro@gmail.com>,
"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: revision: propagate flag bits from tags to pointees
Date: Wed, 15 Jan 2014 14:25:22 -0800 [thread overview]
Message-ID: <xmqqk3e0288d.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140115215641.GB16401@sigill.intra.peff.net> (Jeff King's message of "Wed, 15 Jan 2014 16:56:41 -0500")
Jeff King <peff@peff.net> writes:
> Looks good to me. As per my previous mail, I _think_ you could squash
> in:
>
> diff --git a/revision.c b/revision.c
> index f786b51..2db906c 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -316,13 +316,10 @@ static struct commit *handle_commit(struct rev_info *revs,
> * Blob object? You know the drill by now..
> */
> if (object->type == OBJ_BLOB) {
> - struct blob *blob = (struct blob *)object;
> if (!revs->blob_objects)
> return NULL;
> - if (flags & UNINTERESTING) {
> - mark_blob_uninteresting(blob);
> + if (flags & UNINTERESTING)
> return NULL;
> - }
> add_pending_object(revs, object, "");
> return NULL;
> }
>
> but that is not very much code reduction (and mark_blob_uninteresting is
> very cheap). So it may not be worth the risk that my analysis is wrong.
> :)
Your analysis is correct, but I think the pros-and-cons of the your
squashable change boils down to the choice between:
- leaving it in will keep similarity between tree and blob
codepaths (both have mark_X_uninteresting(); and
- reducing cycles by taking advantage of the explicit knowledge
that mark_X_uninteresting() recurses for a tree while it does not
for a blob.
But I have a suspicion that my patch may break if any codepath looks
at the current flag on the object and decides "ah, it already is
marked" and punts.
It indeed looks like mark_tree_uninteresting() does have that
property. When an uninteresting tag directly points at a tree, if
we propagate the UNINTERESTING bit to the pointee while peeling,
wouldn't we end up calling mark_tree_uninteresting() on a tree,
whose flags already have UNINTERESTING bit set, causing it not to
recurse?
next prev parent reply other threads:[~2014-01-15 22:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-10 13:15 git-log --cherry-pick gives different results when using tag or tag^{} Francis Moreau
2014-01-15 9:49 ` Jeff King
2014-01-15 9:59 ` Francis Moreau
2014-01-15 19:57 ` Junio C Hamano
2014-01-15 20:26 ` revision: propagate flag bits from tags to pointees Junio C Hamano
2014-01-15 21:56 ` Jeff King
2014-01-15 22:25 ` Junio C Hamano [this message]
2014-01-15 22:41 ` Junio C Hamano
2014-01-15 21:53 ` git-log --cherry-pick gives different results when using tag or tag^{} Jeff King
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=xmqqk3e0288d.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=francis.moro@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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.