All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: Show remote branches on gitweb
Date: Mon, 27 Nov 2006 20:26:09 +0100	[thread overview]
Message-ID: <ekfe15$a48$1@sea.gmane.org> (raw)
In-Reply-To: loom.20061127T200958-750@post.gmane.org

Pazu wrote:

> Jakub Narebski <jnareb <at> gmail.com> writes:
> 
>> > Is there any way to do it? I'm using git-svn to track a remote
>> > subversion repository, and it would be very nice to browse the
>> > history for a remote branch for which I didn't start a local
>> >branch yet.
>> 
>> Planned, not implemented yet.
> 
> Probably not a technically correct solution, but the following changes did the
> trick for me.
> 
> 
> --- a/gitweb.cgi      2006-11-23 11:02:34.000000000 -0200
> +++ b/gitweb.cgi      2006-11-27 10:09:56.000000000 -0200
> @@ -1428,8 +1431,7 @@
>  
>       open my $fd, '-|', git_cmd(), 'for-each-ref',
>               ($limit ? '--count='.($limit+1) : ()), '--sort=-committerdate',
> -             '--format=%(objectname) %(refname) %(subject)%00%(committer)',
> -             'refs/heads'
> +             '--format=%(objectname) %(refname) %(subject)%00%(committer)'
>               or return;
>       while (my $line = <$fd>) {
>               my %ref_item;
> @@ -1440,6 +1442,7 @@
>               my ($committer, $epoch, $tz) =
>                       ($committerinfo =~ /^(.*) ([0-9]+) (.*)$/);
>               $name =~ s!^refs/heads/!!;
> +             $name =~ s!^refs/remotes/!!;
>  
>               $ref_item{'name'}  = $name;
>               $ref_item{'id'}    = $hash;
> 
> 
> 
> I've just changed the git_get_heads_list function to let 'for-each-ref'
> return all top refs instead of just those in refs/heads, and added a line to
> remove 'refs/remotes/' from the remote branch names.
> 
> Again, probably not the right solution, but now I have remote branches listed
> under "heads", and that's all I really need.

What about tags (refs/tags/), which shouldn't be here?

Besides, it is quick'n'dirty solution; I'm not against having it as a patch
in git mailing list archives, but I'd rather not have it there.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


  reply	other threads:[~2006-11-27 19:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-24 20:06 Show remote branches on gitweb Pazu
2006-11-24 20:17 ` Jakub Narebski
2006-11-24 20:56   ` Jakub Narebski
2006-11-24 23:59     ` Petr Baudis
2006-11-25  0:12       ` Jakub Narebski
2006-11-25  0:40       ` Junio C Hamano
2006-11-25  0:50         ` Petr Baudis
2006-11-25  1:04           ` Junio C Hamano
2006-11-28 15:14     ` Jakub Narebski
2006-11-27 19:20   ` Pazu
2006-11-27 19:26     ` Jakub Narebski [this message]
2006-11-28  2:59       ` Pazu

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='ekfe15$a48$1@sea.gmane.org' \
    --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.