* Show remote branches on gitweb
@ 2006-11-24 20:06 Pazu
2006-11-24 20:17 ` Jakub Narebski
0 siblings, 1 reply; 12+ messages in thread
From: Pazu @ 2006-11-24 20:06 UTC (permalink / raw)
To: git
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.
-- Pazu
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Show remote branches on gitweb
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-27 19:20 ` Pazu
0 siblings, 2 replies; 12+ messages in thread
From: Jakub Narebski @ 2006-11-24 20:17 UTC (permalink / raw)
To: git
Pazu wrote:
> 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.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Show remote branches on gitweb
2006-11-24 20:17 ` Jakub Narebski
@ 2006-11-24 20:56 ` Jakub Narebski
2006-11-24 23:59 ` Petr Baudis
2006-11-28 15:14 ` Jakub Narebski
2006-11-27 19:20 ` Pazu
1 sibling, 2 replies; 12+ messages in thread
From: Jakub Narebski @ 2006-11-24 20:56 UTC (permalink / raw)
To: git
Jakub Narebski wrote:
> Pazu wrote:
>
>> 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.
The problem is that to implement it _well_ we have to get remotes, both
$GIT_DIR/remotes and config remote.xxx, info. And the latter (config
remotes info) needs config parsing, something we lack.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Show remote branches on gitweb
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-28 15:14 ` Jakub Narebski
1 sibling, 2 replies; 12+ messages in thread
From: Petr Baudis @ 2006-11-24 23:59 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
On Fri, Nov 24, 2006 at 09:56:29PM CET, Jakub Narebski wrote:
> Jakub Narebski wrote:
>
> > Pazu wrote:
> >
> >> 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.
>
> The problem is that to implement it _well_ we have to get remotes, both
> $GIT_DIR/remotes and config remote.xxx, info. And the latter (config
> remotes info) needs config parsing, something we lack.
Does that mean we _can_ parse $GIT_DIR/remotes? ;-)
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
The meaning of Stonehenge in Traflamadorian, when viewed from above, is:
"Replacement part being rushed with all possible speed."
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Show remote branches on gitweb
2006-11-24 23:59 ` Petr Baudis
@ 2006-11-25 0:12 ` Jakub Narebski
2006-11-25 0:40 ` Junio C Hamano
1 sibling, 0 replies; 12+ messages in thread
From: Jakub Narebski @ 2006-11-25 0:12 UTC (permalink / raw)
To: git
Petr Baudis wrote:
> On Fri, Nov 24, 2006 at 09:56:29PM CET, Jakub Narebski wrote:
>> Jakub Narebski wrote:
>>
>>> Pazu wrote:
>>>
>>>> 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.
>>
>> The problem is that to implement it _well_ we have to get remotes, both
>> $GIT_DIR/remotes and config remote.xxx, info. And the latter (config
>> remotes info) needs config parsing, something we lack.
>
> Does that mean we _can_ parse $GIT_DIR/remotes? ;-)
No, but for implementing showing remote branches in gitweb _well_,
but without frills'n'whistles, it is enough to know files in
$GIT_DIR/remotes (Find::find those files), and don't need to parse
remotes/ files.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Show remote branches on gitweb
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
1 sibling, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2006-11-25 0:40 UTC (permalink / raw)
To: Petr Baudis; +Cc: git, Jakub Narebski
Petr Baudis <pasky@suse.cz> writes:
>> The problem is that to implement it _well_ we have to get remotes, both
>> $GIT_DIR/remotes and config remote.xxx, info. And the latter (config
>> remotes info) needs config parsing, something we lack.
>
> Does that mean we _can_ parse $GIT_DIR/remotes? ;-)
Surely you should be able to. You are working in Perl and the
remotes and config are trivially parsable text files.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Show remote branches on gitweb
2006-11-25 0:40 ` Junio C Hamano
@ 2006-11-25 0:50 ` Petr Baudis
2006-11-25 1:04 ` Junio C Hamano
0 siblings, 1 reply; 12+ messages in thread
From: Petr Baudis @ 2006-11-25 0:50 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jakub Narebski
On Sat, Nov 25, 2006 at 01:40:23AM CET, Junio C Hamano wrote:
> Petr Baudis <pasky@suse.cz> writes:
>
> >> The problem is that to implement it _well_ we have to get remotes, both
> >> $GIT_DIR/remotes and config remote.xxx, info. And the latter (config
> >> remotes info) needs config parsing, something we lack.
> >
> > Does that mean we _can_ parse $GIT_DIR/remotes? ;-)
>
> Surely you should be able to. You are working in Perl and the
> remotes and config are trivially parsable text files.
But so is the configuration file, unless I'm missing something...?
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
The meaning of Stonehenge in Traflamadorian, when viewed from above, is:
"Replacement part being rushed with all possible speed."
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Show remote branches on gitweb
2006-11-25 0:50 ` Petr Baudis
@ 2006-11-25 1:04 ` Junio C Hamano
0 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2006-11-25 1:04 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
Petr Baudis <pasky@suse.cz> writes:
>> > Does that mean we _can_ parse $GIT_DIR/remotes? ;-)
>>
>> Surely you should be able to. You are working in Perl and the
>> remotes and config are trivially parsable text files.
>
> But so is the configuration file, unless I'm missing something...?
I do not think you are missing anything. I said that remotes
and config are simple trivially parsable text files and Perl
should be a pleasant tool to read them with.
So yes, we _can_ parse them, and we _can_ parse configuration
file.
Unless I'm missing something...?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Show remote branches on gitweb
2006-11-24 20:17 ` Jakub Narebski
2006-11-24 20:56 ` Jakub Narebski
@ 2006-11-27 19:20 ` Pazu
2006-11-27 19:26 ` Jakub Narebski
1 sibling, 1 reply; 12+ messages in thread
From: Pazu @ 2006-11-27 19:20 UTC (permalink / raw)
To: git
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Show remote branches on gitweb
2006-11-27 19:20 ` Pazu
@ 2006-11-27 19:26 ` Jakub Narebski
2006-11-28 2:59 ` Pazu
0 siblings, 1 reply; 12+ messages in thread
From: Jakub Narebski @ 2006-11-27 19:26 UTC (permalink / raw)
To: git
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Show remote branches on gitweb
2006-11-27 19:26 ` Jakub Narebski
@ 2006-11-28 2:59 ` Pazu
0 siblings, 0 replies; 12+ messages in thread
From: Pazu @ 2006-11-28 2:59 UTC (permalink / raw)
To: git
Jakub Narebski <jnareb <at> gmail.com> writes:
> What about tags (refs/tags/), which shouldn't be here?
Yeah, I just noticed that when I pointed gitweb to git's own repository (my
project's repository currently has no tags). I've added a "next if $name =~
m!^refs/tags/!;" for now.
> 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.
Yes, it's quick and dirty. I didn't mean to have it published anywhere (and to
anyone reading this from the archives: please don't use that ugly, quick, and
really dirty patch).
I posted it as a way to say that I'm one more happy git user. While one could
say that hacking gitweb to achieve happiness is cheating, the fact that I
*could* do that easily, even when I barely understand perl, is a really big plus
for me. You guys rock, really.
-- Pazu
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Show remote branches on gitweb
2006-11-24 20:56 ` Jakub Narebski
2006-11-24 23:59 ` Petr Baudis
@ 2006-11-28 15:14 ` Jakub Narebski
1 sibling, 0 replies; 12+ messages in thread
From: Jakub Narebski @ 2006-11-28 15:14 UTC (permalink / raw)
To: git
Jakub Narebski wrote:
> Jakub Narebski wrote:
>
>> Pazu wrote:
>>
>>> 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.
>
> The problem is that to implement it _well_ we have to get remotes, both
> $GIT_DIR/remotes and config remote.xxx, info. And the latter (config
> remotes info) needs config parsing, something we lack.
We could simplify things, and assume that remote name is _never_
hierarchical, so that remote branches names are:
remotes/<remote>/<branch>
where <remote> does not contain '/'.
Additional problem is for "summary" view: should we limit number of heads
per remote, should we sort heads inside remote, or should we also sort
remotes, or should we sort remotes by time without grouping into repos?
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-11-28 15:14 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2006-11-28 2:59 ` Pazu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).