Re: Show remote branches on gitweb
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Nov 27, 2006, 19:26 UTC
- Message-ID
- <ekfe15$a48$1@sea.gmane.org>
- In-Reply-To
- <loom.20061127T200958-750@post.gmane.org>
Pazu wrote:
Show 42 quoted lines
> 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