Re: Show remote branches on gitweb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- Pazu

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]