Re: [PATCH] gitweb: Use git-show-ref instead of git-peek-remote
- From
Junio C Hamano <junkio@cox.net>
- Date
- Nov 24, 2006, 22:20 UTC
- Message-ID
- <7vhcwoa3mx.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <11644056823095-git-send-email-jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
> Use "git show-ref --dereference" instead of "git peek-remote ." in > 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.
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.
> 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.