{"thread":{"id":"43562","subject":"Re: Show remote branches on gitweb","startedAt":"2006-11-24T20:06:58Z","lastAt":"2006-11-28T15:14:39Z","messageCount":12,"participants":["Jakub Narebski","Junio C Hamano","Petr Baudis","Pazu"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"298622","messageId":"loom.20061124T210559-701@post.gmane.org","threadId":"43562","inReplyTo":null,"subject":"Show remote branches on gitweb","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-11-24T20:06:58Z","receivedAt":"2006-11-24T20:06:58Z","isPatch":false,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"Is there any way to do it? I'm using git-svn to track a remote subversion\nrepository, and it would be very nice to browse the history for a remote branch\nfor which I didn't start a local branch yet.\n\n-- Pazu\n"},{"id":"295548","messageId":"ek7jsp$j83$1@sea.gmane.org","threadId":"43562","inReplyTo":"loom.20061124T210559-701@post.gmane.org","subject":"Re: Show remote branches on gitweb","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-24T20:17:05Z","receivedAt":"2006-11-24T20:17:05Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Pazu wrote:\n\n> Is there any way to do it? I'm using git-svn to track a remote subversion\n> repository, and it would be very nice to browse the history for a remote branch\n> for which I didn't start a local branch yet.\n\nPlanned, not implemented yet.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"297642","messageId":"ek7m6m$qqd$1@sea.gmane.org","threadId":"43562","inReplyTo":"ek7jsp$j83$1@sea.gmane.org","subject":"Re: Show remote branches on gitweb","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-24T20:56:29Z","receivedAt":"2006-11-24T20:56:29Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jakub Narebski wrote:\n\n> Pazu wrote:\n> \n>> Is there any way to do it? I'm using git-svn to track a remote subversion\n>> repository, and it would be very nice to browse the history for a remote branch\n>> for which I didn't start a local branch yet.\n> \n> Planned, not implemented yet.\n\nThe problem is that to implement it _well_ we have to get remotes, both\n$GIT_DIR/remotes and config remote.xxx, info. And the latter (config\nremotes info) needs config parsing, something we lack.\n \n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"296577","messageId":"20061124235911.GO7201@pasky.or.cz","threadId":"43562","inReplyTo":"ek7m6m$qqd$1@sea.gmane.org","subject":"Re: Show remote branches on gitweb","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-11-24T23:59:11Z","receivedAt":"2006-11-24T23:59:11Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Fri, Nov 24, 2006 at 09:56:29PM CET, Jakub Narebski wrote:\n> Jakub Narebski wrote:\n> \n> > Pazu wrote:\n> > \n> >> Is there any way to do it? I'm using git-svn to track a remote subversion\n> >> repository, and it would be very nice to browse the history for a remote branch\n> >> for which I didn't start a local branch yet.\n> > \n> > Planned, not implemented yet.\n> \n> The problem is that to implement it _well_ we have to get remotes, both\n> $GIT_DIR/remotes and config remote.xxx, info. And the latter (config\n> remotes info) needs config parsing, something we lack.\n\nDoes that mean we _can_ parse $GIT_DIR/remotes? ;-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nThe meaning of Stonehenge in Traflamadorian, when viewed from above, is:\n\"Replacement part being rushed with all possible speed.\"\n"},{"id":"298611","messageId":"ek81mv$qd8$1@sea.gmane.org","threadId":"43562","inReplyTo":"20061124235911.GO7201@pasky.or.cz","subject":"Re: Show remote branches on gitweb","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-25T00:12:55Z","receivedAt":"2006-11-25T00:12:55Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Petr Baudis wrote:\n\n> On Fri, Nov 24, 2006 at 09:56:29PM CET, Jakub Narebski wrote:\n>> Jakub Narebski wrote:\n>> \n>>> Pazu wrote:\n>>> \n>>>> Is there any way to do it? I'm using git-svn to track a remote subversion\n>>>> repository, and it would be very nice to browse the history for a remote branch\n>>>> for which I didn't start a local branch yet.\n>>> \n>>> Planned, not implemented yet.\n>> \n>> The problem is that to implement it _well_ we have to get remotes, both\n>> $GIT_DIR/remotes and config remote.xxx, info. And the latter (config\n>> remotes info) needs config parsing, something we lack.\n> \n> Does that mean we _can_ parse $GIT_DIR/remotes? ;-)\n\nNo, but for implementing showing remote branches in gitweb _well_,\nbut without frills'n'whistles, it is enough to know files in\n$GIT_DIR/remotes (Find::find those files), and don't need to parse\nremotes/ files.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"296257","messageId":"7vy7q08iko.fsf@assigned-by-dhcp.cox.net","threadId":"43562","inReplyTo":"20061124235911.GO7201@pasky.or.cz","subject":"Re: Show remote branches on gitweb","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-25T00:40:23Z","receivedAt":"2006-11-25T00:40:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n>> The problem is that to implement it _well_ we have to get remotes, both\n>> $GIT_DIR/remotes and config remote.xxx, info. And the latter (config\n>> remotes info) needs config parsing, something we lack.\n>\n> Does that mean we _can_ parse $GIT_DIR/remotes? ;-)\n\nSurely you should be able to.  You are working in Perl and the\nremotes and config are trivially parsable text files.\n\n\n\n"},{"id":"298297","messageId":"20061125005029.GN4842@pasky.or.cz","threadId":"43562","inReplyTo":"7vy7q08iko.fsf@assigned-by-dhcp.cox.net","subject":"Re: Show remote branches on gitweb","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-11-25T00:50:29Z","receivedAt":"2006-11-25T00:50:29Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sat, Nov 25, 2006 at 01:40:23AM CET, Junio C Hamano wrote:\n> Petr Baudis <pasky@suse.cz> writes:\n> \n> >> The problem is that to implement it _well_ we have to get remotes, both\n> >> $GIT_DIR/remotes and config remote.xxx, info. And the latter (config\n> >> remotes info) needs config parsing, something we lack.\n> >\n> > Does that mean we _can_ parse $GIT_DIR/remotes? ;-)\n> \n> Surely you should be able to.  You are working in Perl and the\n> remotes and config are trivially parsable text files.\n\nBut so is the configuration file, unless I'm missing something...?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nThe meaning of Stonehenge in Traflamadorian, when viewed from above, is:\n\"Replacement part being rushed with all possible speed.\"\n"},{"id":"298417","messageId":"7vu00o8hh4.fsf@assigned-by-dhcp.cox.net","threadId":"43562","inReplyTo":"20061125005029.GN4842@pasky.or.cz","subject":"Re: Show remote branches on gitweb","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-25T01:04:07Z","receivedAt":"2006-11-25T01:04:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n>> > Does that mean we _can_ parse $GIT_DIR/remotes? ;-)\n>> \n>> Surely you should be able to.  You are working in Perl and the\n>> remotes and config are trivially parsable text files.\n>\n> But so is the configuration file, unless I'm missing something...?\n\nI do not think you are missing anything.  I said that remotes\nand config are simple trivially parsable text files and Perl\nshould be a pleasant tool to read them with.\n\nSo yes, we _can_ parse them, and we _can_ parse configuration\nfile.\n\nUnless I'm missing something...?\n\n"},{"id":"297318","messageId":"loom.20061127T200958-750@post.gmane.org","threadId":"43562","inReplyTo":"ek7jsp$j83$1@sea.gmane.org","subject":"Re: Show remote branches on gitweb","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-11-27T19:20:05Z","receivedAt":"2006-11-27T19:20:05Z","isPatch":false,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"Jakub Narebski <jnareb <at> gmail.com> writes:\n\n> > Is there any way to do it? I'm using git-svn to track a remote\n> > subversion repository, and it would be very nice to browse the\n> > history for a remote branch for which I didn't start a local\n> >branch yet.\n> \n> Planned, not implemented yet.\n\nProbably not a technically correct solution, but the following changes did the\ntrick for me.\n\n\n--- a/gitweb.cgi\t2006-11-23 11:02:34.000000000 -0200\n+++ b/gitweb.cgi\t2006-11-27 10:09:56.000000000 -0200\n@@ -1428,8 +1431,7 @@\n \n \topen my $fd, '-|', git_cmd(), 'for-each-ref',\n \t\t($limit ? '--count='.($limit+1) : ()), '--sort=-committerdate',\n-\t\t'--format=%(objectname) %(refname) %(subject)%00%(committer)',\n-\t\t'refs/heads'\n+\t\t'--format=%(objectname) %(refname) %(subject)%00%(committer)'\n \t\tor return;\n \twhile (my $line = <$fd>) {\n \t\tmy %ref_item;\n@@ -1440,6 +1442,7 @@\n \t\tmy ($committer, $epoch, $tz) =\n \t\t\t($committerinfo =~ /^(.*) ([0-9]+) (.*)$/);\n \t\t$name =~ s!^refs/heads/!!;\n+\t\t$name =~ s!^refs/remotes/!!;\n \n \t\t$ref_item{'name'}  = $name;\n \t\t$ref_item{'id'}    = $hash;\n\n\n\nI've just changed the git_get_heads_list function to let 'for-each-ref'\nreturn all top refs instead of just those in refs/heads, and added a line to\nremove 'refs/remotes/' from the remote branch names.\n\nAgain, probably not the right solution, but now I have remote branches listed\nunder \"heads\", and that's all I really need.\n\n-- Pazu\n"},{"id":"296552","messageId":"ekfe15$a48$1@sea.gmane.org","threadId":"43562","inReplyTo":"loom.20061127T200958-750@post.gmane.org","subject":"Re: Show remote branches on gitweb","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-27T19:26:09Z","receivedAt":"2006-11-27T19:26:09Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Pazu wrote:\n\n> Jakub Narebski <jnareb <at> gmail.com> writes:\n> \n>> > Is there any way to do it? I'm using git-svn to track a remote\n>> > subversion repository, and it would be very nice to browse the\n>> > history for a remote branch for which I didn't start a local\n>> >branch yet.\n>> \n>> Planned, not implemented yet.\n> \n> Probably not a technically correct solution, but the following changes did the\n> trick for me.\n> \n> \n> --- a/gitweb.cgi      2006-11-23 11:02:34.000000000 -0200\n> +++ b/gitweb.cgi      2006-11-27 10:09:56.000000000 -0200\n> @@ -1428,8 +1431,7 @@\n>  \n>       open my $fd, '-|', git_cmd(), 'for-each-ref',\n>               ($limit ? '--count='.($limit+1) : ()), '--sort=-committerdate',\n> -             '--format=%(objectname) %(refname) %(subject)%00%(committer)',\n> -             'refs/heads'\n> +             '--format=%(objectname) %(refname) %(subject)%00%(committer)'\n>               or return;\n>       while (my $line = <$fd>) {\n>               my %ref_item;\n> @@ -1440,6 +1442,7 @@\n>               my ($committer, $epoch, $tz) =\n>                       ($committerinfo =~ /^(.*) ([0-9]+) (.*)$/);\n>               $name =~ s!^refs/heads/!!;\n> +             $name =~ s!^refs/remotes/!!;\n>  \n>               $ref_item{'name'}  = $name;\n>               $ref_item{'id'}    = $hash;\n> \n> \n> \n> I've just changed the git_get_heads_list function to let 'for-each-ref'\n> return all top refs instead of just those in refs/heads, and added a line to\n> remove 'refs/remotes/' from the remote branch names.\n> \n> Again, probably not the right solution, but now I have remote branches listed\n> under \"heads\", and that's all I really need.\n\nWhat about tags (refs/tags/), which shouldn't be here?\n\nBesides, it is quick'n'dirty solution; I'm not against having it as a patch\nin git mailing list archives, but I'd rather not have it there.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"297009","messageId":"loom.20061128T033926-990@post.gmane.org","threadId":"43562","inReplyTo":"ekfe15$a48$1@sea.gmane.org","subject":"Re: Show remote branches on gitweb","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-11-28T02:59:27Z","receivedAt":"2006-11-28T02:59:27Z","isPatch":false,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"Jakub Narebski <jnareb <at> gmail.com> writes:\n\n> What about tags (refs/tags/), which shouldn't be here?\n\nYeah, I just noticed that when I pointed gitweb to git's own repository (my\nproject's repository currently has no tags). I've added a \"next if $name =~\nm!^refs/tags/!;\" for now.\n\n> Besides, it is quick'n'dirty solution; I'm not against having it as a patch\n> in git mailing list archives, but I'd rather not have it there.\n\nYes, it's quick and dirty. I didn't mean to have it published anywhere (and to\nanyone reading this from the archives: please don't use that ugly, quick, and\nreally dirty patch).\n\nI posted it as a way to say that I'm one more happy git user. While one could\nsay that hacking gitweb to achieve happiness is cheating, the fact that I\n*could* do that easily, even when I barely understand perl, is a really big plus\nfor me. You guys rock, really.\n\n-- Pazu\n"},{"id":"298229","messageId":"ekhjlo$jv0$1@sea.gmane.org","threadId":"43562","inReplyTo":"ek7m6m$qqd$1@sea.gmane.org","subject":"Re: Show remote branches on gitweb","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-28T15:14:39Z","receivedAt":"2006-11-28T15:14:39Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jakub Narebski wrote:\n\n> Jakub Narebski wrote:\n> \n>> Pazu wrote:\n>> \n>>> Is there any way to do it? I'm using git-svn to track a remote subversion\n>>> repository, and it would be very nice to browse the history for a remote branch\n>>> for which I didn't start a local branch yet.\n>> \n>> Planned, not implemented yet.\n> \n> The problem is that to implement it _well_ we have to get remotes, both\n> $GIT_DIR/remotes and config remote.xxx, info. And the latter (config\n> remotes info) needs config parsing, something we lack.\n\nWe could simplify things, and assume that remote name is _never_\nhierarchical, so that remote branches names are:\n  remotes/<remote>/<branch>\nwhere <remote> does not contain '/'.\n\nAdditional problem is for \"summary\" view: should we limit number of heads\nper remote, should we sort heads inside remote, or should we also sort\nremotes, or should we sort remotes by time without grouping into repos?\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"}]}