From: "Shawn O. Pearce" <spearce@spearce•org>
To: Daniel Barkalow <barkalow@iabervon•org>
Cc: Junio C Hamano <gitster@pobox•com>,
git@vger•kernel.org, Nicolas Pitre <nico@cam•org>
Subject: Re: [PATCH 1/3] git-pack-objects: Automatically pack annotated tags if object was packed
Date: Mon, 3 Mar 2008 22:06:31 -0500 [thread overview]
Message-ID: <20080304030631.GN8410@spearce.org> (raw)
In-Reply-To: <alpine.LNX.1.00.0803032145480.19665@iabervon.org>
Daniel Barkalow <barkalow@iabervon•org> wrote:
> On Mon, 3 Mar 2008, Shawn O. Pearce wrote:
>
> > + if (auto_tags && nr_result)
> > + for_each_ref(add_ref_tag, NULL);
>
> There's for_each_tag_ref() that does the path-based filter internally, in
> a possibly more efficient way, and avoids open-coding the test for whether
> this is a tag sort of ref.
Yea, I know about that call, but I didn't use it because I was
trying to use peel_ref() for its optimized peeled caching in
a packed-refs file.
To use peel_ref() you have to pass the full ref name ("refs/tags/v1.0")
and not a partial ref name ("v1.0") such as for_each_tag_ref() will
return to the callback function. So I'd have to actually do extra
work to reconstruct a ref name, and possibly an invalid ref name at
that if for_each_tag_ref() ever looked outside of the refs/tags/
namespace.
Today there is no performance benefit to for_each_tag_ref() over
for_each_ref(), but using for_each_ref() lets me use peel_ref(),
which is a performance improvement if the ref in question came from
the packed-refs file.
So.... do we keep things as-is or try to optimize peel_ref() (or
some new variant of it?!?) for use in for_each_tag_ref() just on
the off chance that we somehow can optimize for_each_tag_ref to
avoid scanning refs/heads/? Note that I did look into trying to
do that optimization to for_each_tag_ref() earlier last week and
concluded it wasn't easily possible right now, and wasn't likely
to be worth the development costs.
--
Shawn.
next prev parent reply other threads:[~2008-03-04 3:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-04 2:36 [PATCH 1/3] git-pack-objects: Automatically pack annotated tags if object was packed Shawn O. Pearce
2008-03-04 2:45 ` Nicolas Pitre
2008-03-04 3:06 ` Shawn O. Pearce
2008-03-04 7:27 ` Johannes Sixt
2008-03-05 6:32 ` Shawn O. Pearce
2008-03-04 2:49 ` Daniel Barkalow
2008-03-04 3:06 ` Shawn O. Pearce [this message]
2008-03-04 3:11 ` Daniel Barkalow
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=20080304030631.GN8410@spearce.org \
--to=spearce@spearce$(echo .)org \
--cc=barkalow@iabervon$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=nico@cam$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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