From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH 1/2] gitweb: Always use git-peek-remote in git_get_references
Date: Sun, 17 Sep 2006 02:37:00 +0200 [thread overview]
Message-ID: <200609170237.00593.jnareb@gmail.com> (raw)
In-Reply-To: <200609170226.39330.jnareb@gmail.com>
Instead of trying to read info/refs file, which might not be present
(we did fallback to git-ls-remote), always use git-peek-remote in
git_get_references.
It is preparation for git_get_refs_info to also return references
info. We cannot use info/refs for git_get_refs_info as the information
contained therein is usually stale.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch should be before the one it is reply to, i.e.
gitweb: Make git_get_refs_list do work of git_get_references
gitweb/gitweb.perl | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a81c8d4..8c3c13d 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -786,16 +786,10 @@ sub git_get_project_owner {
sub git_get_references {
my $type = shift || "";
my %refs;
- my $fd;
# 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c refs/tags/v2.6.11
# c39ae07f393806ccf406ef966e9a15afc43cc36a refs/tags/v2.6.11^{}
- if (-f "$projectroot/$project/info/refs") {
- open $fd, "$projectroot/$project/info/refs"
- or return;
- } else {
- open $fd, "-|", git_cmd(), "ls-remote", "."
- or return;
- }
+ open my $fd, "-|", $GIT, "peek-remote", "$projectroot/$project/"
+ or return;
while (my $line = <$fd>) {
chomp $line;
--
1.4.2.1
next prev parent reply other threads:[~2006-09-17 0:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-17 0:26 [PATCH] gitweb: Make git_get_refs_list do work of git_get_references Jakub Narebski
2006-09-17 0:37 ` Jakub Narebski [this message]
2006-09-17 1:22 ` Junio C Hamano
2006-09-17 1:40 ` Randal L. Schwartz
2006-09-17 2:12 ` Junio C Hamano
2006-09-17 2:17 ` Randal L. Schwartz
2006-09-17 2:29 ` Junio C Hamano
[not found] ` <200609171057.56467.jnareb@gmail.com>
[not found] ` <7vfyeq6dn3.fsf@assigned-by-dhcp.cox.net>
2006-09-17 10:00 ` [PATCH 2/2 (take 2)] " Jakub Narebski
2006-09-17 10:02 ` Jakub Narebski
2006-09-17 10:06 ` Jakub Narebski
-- strict thread matches above, loose matches on Subject: below --
2006-09-19 12:30 [PATCH 0/2] " Jakub Narebski
2006-09-19 12:31 ` [PATCH 1/2] gitweb: Always use git-peek-remote in git_get_references Jakub Narebski
2006-09-20 16:09 ` Junio C Hamano
2006-09-20 18:13 ` Jakub Narebski
2006-09-21 9:07 ` Andreas Ericsson
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=200609170237.00593.jnareb@gmail.com \
--to=jnareb@gmail.com \
--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 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.