From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH/RFC] avoid accessing _all_ loose refs in git-show-ref
Date: Sat, 16 Dec 2006 05:12:32 -0800 [thread overview]
Message-ID: <7vk60sf0hr.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0612161335140.3635@wbgn013.biozentrum.uni-wuerzburg.de> (Johannes Schindelin's message of "Sat, 16 Dec 2006 13:36:43 +0100 (CET)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> This is kind of quick and dirty.
Maybe I am blind, but why don't you just do a resolve_ref()
regardless of packedness? It only builds the packed refs list
when it is not found as a loose ref, and never builds the loose
refs list. You probably would want to reject the ones that says
REF_ISSYMREF.
> An alternative would be to pack the tags _per default_. I once
> argued for that, but it appears nobody liked that idea. I even
> proposed to pack _all_ refs, and I still think this would be
> a good idea.
I do not think packing all refs is such a good idea. Branches
are meant to be worked on and extended so the packed ones
would become stale quickly. Packing all tags by default is
something we would want when everybody knows how to handle
them.
> Isn't it a bug that --verify succeeds, if only _one_ ref passed to
> the command exists?
I think --verify should insist a single parameter, just like
rev-parse.
So wouldn't the code be like:
if (verify) {
int flag;
if (pattern[1])
die("Eh?");
if (resolve_ref(pattern[0], sha1, 1, &flag) &&
(flag & REF_ISSYMREF) == 0) {
printf("%s %s\n",
sha1_to_hex(sha1), pattern[0]);
exit(0);
} else
die("no match");
}
???
next prev parent reply other threads:[~2006-12-16 13:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-16 12:36 [PATCH/RFC] avoid accessing _all_ loose refs in git-show-ref Johannes Schindelin
2006-12-16 13:12 ` Junio C Hamano [this message]
2006-12-16 14:20 ` Johannes Schindelin
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=7vk60sf0hr.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.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