From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: Use git-show-ref instead of git-peek-remote
Date: Fri, 24 Nov 2006 23:35:15 +0100 [thread overview]
Message-ID: <200611242335.15964.jnareb@gmail.com> (raw)
In-Reply-To: <7vhcwoa3mx.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> Use "git show-ref --dereference" instead of "git peek-remote ." in
It should be
Use "git show-ref --dereference" instead of "git peek-remote <project>"
>> git_get_references. git-show-ref is faster than git-peek-remote; even
>> faster is reading info/refs file (if it exists), but the information
>> in info/refs can be stale.
>
> More importantly, it is for dumb protocol transports, not for gitweb.
Yes, but if it is there, why not make use of it? Especially that it
is used only (I think) for refs markers, and not for anything important.
On the other side a bit of performance here doesn't matter much.
> You forgot to mention that you fixed the last place that
> directly used "$GIT" to invoke the command, bypassing sub
> git_cmd. That is a consistency clean-up worth mentioning.
This is not fix, this is change of style. The style was to use
git peek-remote $projectroot/$project
instead of equivalent
git --git-dir=$projectroot/$project peek-remote .
We don't have this choice with git-show-ref.
On the other hand that makes all command invocation (except the one
used for getting git core version) pass through git_cmd() subroutine.
>> git-show-ref is available since v1.4.4; the output format is slightly
>> different than git-peek-remote output format.
>
>> - if ($line =~ m/^([0-9a-fA-F]{40})\trefs\/($type\/?[^\^]+)/) {
>> + if ($line =~ m/^([0-9a-fA-F]{40}) refs\/($type\/?[^\^]+)/) {
>
> I would rather do:
>
> m|^([0-9a-f]{40})\srefs/($type/?[^^]+)|
>
> which would catch both space and tab.
Feel free to do that (one nitpick: is [^^] more readable than [^\^]?).
Should I resend the patch?
--
Jakub Narebski
next prev parent reply other threads:[~2006-11-24 22:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-24 22:01 [PATCH] gitweb: Use git-show-ref instead of git-peek-remote Jakub Narebski
2006-11-24 22:20 ` Junio C Hamano
2006-11-24 22:35 ` Jakub Narebski [this message]
2006-11-25 10:18 ` [PATCH (amend)] " Jakub Narebski
2006-11-25 10:24 ` Jakub Narebski
2006-11-25 10:32 ` [PATCH (take 3)] " Jakub Narebski
2006-11-25 10:42 ` Junio C Hamano
2006-11-25 11:08 ` Jakub Narebski
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=200611242335.15964.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.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 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).