{"thread":{"id":"4592","subject":"[RFC] gitweb wishlist and TODO list","startedAt":"2006-06-20T16:51:18Z","lastAt":"2006-07-01T10:35:52Z","messageCount":35,"participants":["Jakub Narebski","Carl Worth","Petr Baudis","Martin Langhoff","Junio C Hamano","Thomas Glanzmann","Josef Weidendorfer","Dennis Stosberg","Timo Hirvonen","Ryan Anderson","Paul Mackerras"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"22150","messageId":"e79921$u0e$1@sea.gmane.org","threadId":"4592","inReplyTo":null,"subject":"[RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-20T16:51:18Z","receivedAt":"2006-06-20T16:51:18Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"I am planning on copying features from xmms2's gitweb version \nto git's gitweb, and introducing new ones.\n\nMy gitweb can be seen at http://front.fuw.edu.pl/cgi-bin/jnareb/gitweb.cgi\nFetch from http://front.fuw.edu.pl/jnareb/scm/git.git/ (not checked!)\n\n\n* HTML cleanup - ongoing process of replacing embedded style information\n  with CSS styling, adding classes and ids to elements. This is independent \n  on other changes. On top of 'next', as it needs style in separate CSS\n  file gitweb.css.\n\n* Storing site-wide gitweb configuration in separate gitweb.conf file.\n  Needs GIT_CONFIG patch. Not implemented yet.\n\n  Bootstrapping: gitweb would need location of configuration file.\n  Has to be changed in gitweb.cgi itself. Additionally gitexecdir or\n  git in PATH is needed to be able to run git-repo-config to read config;\n  the solution might be home-grown \"parser\" to find gitexecdir only.\n\n  Both could be set from Makefile at install stage.\n\n* Add git fetch URL to the project page from gitweb-xmms2. Needs site-wide\n  base_url, which need not to be set as there is sane default: use base \n  of gitweb URL.\n\n  Is it useful to allow repository configuration to override it?\n\n* Support for categories from gitweb-xmms2. We can alternatively use\n  directory structure of git projects displayed by gitweb as categories.\n  Needs I think some site-wide configuration.\n\n  Question: where store categories? .git/category, like .git/description?\n  Use gitweb.category key? If yes, do convert description to repository key,\n  or perhaps use gitweb.descriptionfile? What should be priority of those\n  options if both are set: use repo-config for short (in project listing \n  and in page footer), and from file for long description on project page?\n  What if they don't match?\n\n* Refactor dispatch from if...elsif...else construction \n  to using 'name' => \\&sub hash.\n\n* Refactor generation of navigation bar. There are at least two\n  implementations of that. With hash dispatch it would be easy to\n  list all possibilities.\n\n* Add (of course optional, like blame support) snapshot support. There are\n  at least two different implementations. I'd prefer to do without second\n  CGI script, but perhaps this is better from the performance point of view.\n  gitweb-xmms2 has snapshot.cgi in Python: should it be rewritten in Perl?\n\n* Code highlighting for plain view for blobs. gitweb-xmms2 did that using\n  GNU highlight program and some embedded configuration (filename regexp to\n  syntax used). More generic: run some post-processing. Configurable\n  globally (perhaps separate \"syntax type\" filename or file magic mapping),\n  and enabled per repository (default off).\n\n* gitweb-xmms2 has something called committags support: it means that\n  'BUG(n)', 'FEATURE(n)' and 'RELEASE: xx' in commit message are turned into\n  bugtracker (Mantis for xmms2) or wiki links. It is extension of turning\n  sha1-ids into references. Probably needs some extra configuration file,\n  and some per repository configuration. Of course we want to support not\n  only Mantis, but also e.g. Bugzilla (e.g. Linux kernel) and conventions\n  for marking bugs therein.\n\n* gitweb-xmms2 has also etags based anchors to mark function definitions \n  in blob view. I'm not sure it would be that usefull. LXR equivalent,\n  perhaps...\n\n\nWhich of those should be implemented first?\n\nAny further ideas for other useful features?\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22151","messageId":"87r71jspeo.wl%cworth@cworth.org","threadId":"4592","inReplyTo":"e79921$u0e$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Carl Worth","fromEmail":"cworth@cworth.org","sentAt":"2006-06-20T17:33:19Z","receivedAt":"2006-06-20T17:33:19Z","isPatch":false,"sender":{"key":"cworth@cworth.org","avatar":"https://gravatar.com/avatar/3746dc28cde609bdbd7f939058356e7e2bbd16d21e32274df0725eb3d998bc5b?d=mp&s=160"},"body":"On Tue, 20 Jun 2006 18:51:18 +0200, Jakub Narebski wrote:\n>\n> Any further ideas for other useful features?\n>\n\nSince you asked...\n\nFrom the first time I saw gitweb the feature I wanted was to put\nmore useful information in the path of the URL rather than in the\nquery string.\n\nOne possible organization might be:\n\n/<project>/<commitish>/<path>[/<more_path> ...]\n\nI'd really like to be able to publish nice clean URLs (without any\nquery component) for getting at particular branches within projects,\nfor example.\n\nThe above might not be entirely feasible in the face of hierachical\nproject names containing '/' characters as they might then conflict\nwith branch names.\n\nAnother general feature I'd like is for URLs to be as interchangeable\nas possible between gitweb and command-line git tools. My goal is to\nbe able to push out a new branch and then send an email announcing the\nbranch with a single URL something like:\n\n\thttp://git.somewhere.org/project/branch\n\nwhere this would obviously work if fed to a web browser, but ideally\nwould also be possible to feed to git-fetch or even git-clone perhaps\nwithout requiring any user knowledge on how to mangle it first.\n\n-Carl\n"},{"id":"22152","messageId":"e79c8t$8sd$1@sea.gmane.org","threadId":"4592","inReplyTo":"87r71jspeo.wl%cworth@cworth.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-20T17:46:11Z","receivedAt":"2006-06-20T17:46:11Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Carl Worth wrote:\n\n> On Tue, 20 Jun 2006 18:51:18 +0200, Jakub Narebski wrote:\n>>\n>> Any further ideas for other useful features?\n>>\n> \n> Since you asked...\n> \n> From the first time I saw gitweb the feature I wanted was to put\n> more useful information in the path of the URL rather than in the\n> query string.\n> \n> One possible organization might be:\n> \n> /<project>/<commitish>/<path>[/<more_path> ...]\n> \n> I'd really like to be able to publish nice clean URLs (without any\n> query component) for getting at particular branches within projects,\n> for example.\n> \n> The above might not be entirely feasible in the face of hierachical\n> project names containing '/' characters as they might then conflict\n> with branch names.\n\nAnd in the face of topic branches with names like 'js/lsfix' or\n'gitweb/config'.\n\nAdd to that the fact that above needs some support from web server\n(e.g. Apache's mod_rewrite) and web server configuration, while gitweb tries\nto be server agnostic...\n\nOne of the part of HTML cleanup would be changing order of URL query string,\nso that the human readable part is first.\n\n\nP.S. I have forgot about:\n* Check how gitweb.cgi behaves with mod_perl, and correct/add modifications\n  to support this mode better (and perhaps also FastCGI if it adds\n  anything).\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22153","messageId":"20060620175505.GR2609@pasky.or.cz","threadId":"4592","inReplyTo":"e79c8t$8sd$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-06-20T17:55:05Z","receivedAt":"2006-06-20T17:55:05Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Tue, Jun 20, 2006 at 07:46:11PM CEST, I got a letter\nwhere Jakub Narebski <jnareb@gmail.com> said that...\n> Add to that the fact that above needs some support from web server\n> (e.g. Apache's mod_rewrite) and web server configuration, while gitweb tries\n> to be server agnostic...\n\nNope, you get the stuff in $PATH_INFO. And having at least just the\nproject name in the path part would be quite nice, it's my common gripe\nwith cvsweb as I frequently get to mangle with the query part manually\n(can be much faster than clicking around) and I have to carefully evade\nthe project name part, which is something I would really expect to be in\nthe \"static\" part of the URL.\n\nWhen we are talking about URLs, it would be quite nice if the query\nparameter names would be actually meaningful instead of some cryptic\n'h', 'pg' and whatnot.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nA person is just about as big as the things that make them angry.\n"},{"id":"22154","messageId":"e79f3p$jcc$1@sea.gmane.org","threadId":"4592","inReplyTo":"20060620175505.GR2609@pasky.or.cz","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-20T18:34:38Z","receivedAt":"2006-06-20T18:34:38Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Petr Baudis wrote:\n\n> Dear diary, on Tue, Jun 20, 2006 at 07:46:11PM CEST, I got a letter\n> where Jakub Narebski <jnareb@gmail.com> said that...\n>> Add to that the fact that above needs some support from web server\n>> (e.g. Apache's mod_rewrite) and web server configuration, while gitweb tries\n>> to be server agnostic...\n> \n> Nope, you get the stuff in $PATH_INFO. And having at least just the\n> project name in the path part would be quite nice, it's my common gripe\n> with cvsweb as I frequently get to mangle with the query part manually\n> (can be much faster than clicking around) and I have to carefully evade\n> the project name part, which is something I would really expect to be in\n> the \"static\" part of the URL.\n\nBut without web server support I think you would need one copy/symbolic link\nper repository served.\n\n> When we are talking about URLs, it would be quite nice if the query\n> parameter names would be actually meaningful instead of some cryptic\n> 'h', 'pg' and whatnot.\n\nI guess that is because hash values are somewhat long (40 characters wide),\nso one letter parameter names were chosen to shorten URL.\n\nDictionary:\n 'a'  - action (e.g. summary, log, commitdiff, blob, tree)\n 'o'  - order by (for sorting tables)\n 'p'  - project (might include category/directory: cogito/cogito.git, \n        git/git.git, git/gitk.git)\n 'f'  - filename (I plan to move it before hash-valued parameters, \n        perhaps except hb which usually is symbolic) \n 'pg' - page\n 's'  - searchtext (shouldn't it be 'q', from querystring?)\n 'h'  - hash\n 'hp' - hash parent (not used yet I think)\n 'hb' - hash base (i.e. head or tag; underused I think)\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22155","messageId":"20060620184020.GS2609@pasky.or.cz","threadId":"4592","inReplyTo":"e79f3p$jcc$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-06-20T18:40:20Z","receivedAt":"2006-06-20T18:40:20Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Tue, Jun 20, 2006 at 08:34:38PM CEST, I got a letter\nwhere Jakub Narebski <jnareb@gmail.com> said that...\n> Petr Baudis wrote:\n> \n> > Nope, you get the stuff in $PATH_INFO. And having at least just the\n> > project name in the path part would be quite nice, it's my common gripe\n> > with cvsweb as I frequently get to mangle with the query part manually\n> > (can be much faster than clicking around) and I have to carefully evade\n> > the project name part, which is something I would really expect to be in\n> > the \"static\" part of the URL.\n> \n> But without web server support I think you would need one copy/symbolic link\n> per repository served.\n\nNope. As I said, the webserver stops in the path at the point it hits\nthe CGI and the rest is in $PATH_INFO.\n\n> > When we are talking about URLs, it would be quite nice if the query\n> > parameter names would be actually meaningful instead of some cryptic\n> > 'h', 'pg' and whatnot.\n> \n> I guess that is because hash values are somewhat long (40 characters wide),\n> so one letter parameter names were chosen to shorten URL.\n\nI might argue that since the hash values are so long, few extra bytes\nfor having the names make some sense aren't going to hurt.\n\nThanks for the dictionary, though. :)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nA person is just about as big as the things that make them angry.\n"},{"id":"22156","messageId":"46a038f90606201233p6283febbn9a46e36c3a666903@mail.gmail.com","threadId":"4592","inReplyTo":"e79921$u0e$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-06-20T19:33:25Z","receivedAt":"2006-06-20T19:33:25Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 6/21/06, Jakub Narebski <jnareb@gmail.com> wrote:\n> I am planning on copying features from xmms2's gitweb version\n> to git's gitweb, and introducing new ones.\n\nCool!\n\n> * Storing site-wide gitweb configuration in separate gitweb.conf file.\n>   Needs GIT_CONFIG patch. Not implemented yet.\n>\n>   Bootstrapping: gitweb would need location of configuration file.\n>   Has to be changed in gitweb.cgi itself. Additionally gitexecdir or\n>   git in PATH is needed to be able to run git-repo-config to read config;\n>   the solution might be home-grown \"parser\" to find gitexecdir only.\n>\n>   Both could be set from Makefile at install stage.\n\nThere's been some discussion about reading GIT_CONFIG from %ENV (but\ndefaulting to the repo config). If GIT_CONFIG is set, I think we can\ntrick git-repo-config to parse it for us.\n\nNow, I suspect we'll want to read _both_ the per-repo config and\nGIT_CONFIG, which is likely to be /etc/gitweb.conf or similar.\n\n> * Add git fetch URL to the project page from gitweb-xmms2. Needs site-wide\n>   base_url, which need not to be set as there is sane default: use base\n>   of gitweb URL.\n>\n>   Is it useful to allow repository configuration to override it?\n\nI think so, as mentioned above.\n\n> * Add (of course optional, like blame support) snapshot support. There are\n>   at least two different implementations. I'd prefer to do without second\n>   CGI script, but perhaps this is better from the performance point of view.\n>   gitweb-xmms2 has snapshot.cgi in Python: should it be rewritten in Perl?\n\nI intend to post a patch that adds snapshot support in Perl, in the\nmain code. Just need to make it optional ;-)\n\n> * Code highlighting for plain view for blobs. gitweb-xmms2 did that using\n>   GNU highlight program and some embedded configuration (filename regexp to\n>   syntax used). More generic: run some post-processing. Configurable\n>   globally (perhaps separate \"syntax type\" filename or file magic mapping),\n>   and enabled per repository (default off).\n\nYep, probably a generic filter facility is better...\n\n> * gitweb-xmms2 has something called committags support: it means that\n>   'BUG(n)', 'FEATURE(n)' and 'RELEASE: xx' in commit message are turned into\n>   bugtracker (Mantis for xmms2) or wiki links. It is extension of turning\n>   sha1-ids into references. Probably needs some extra configuration file,\n>   and some per repository configuration. Of course we want to support not\n>   only Mantis, but also e.g. Bugzilla (e.g. Linux kernel) and conventions\n>   for marking bugs therein.\n\nThat would be great.\n\n...\n\n> Which of those should be implemented first?\n\nI like the order the list has... but it's up to you.\n\n> Any further ideas for other useful features?\n\nNow what I think would rock too is something similar to gitk's \"nearby\ntags\" feature. When reading a commit, it lists the heads and tags that\nthis commit is part of. It's very useful. Now I'll have to read up on\nhow gitk does it.\n\nAnd, as you mention in your other post, mod_perl support. And a bit of\nspeed. Gitweb rght now is really really slow.\n\ncheers,\n\n\n\nmartin\n"},{"id":"22158","messageId":"7vpsh37gqu.fsf@assigned-by-dhcp.cox.net","threadId":"4592","inReplyTo":"e79921$u0e$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-20T19:46:01Z","receivedAt":"2006-06-20T19:46:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> I am planning on copying features from xmms2's gitweb version \n> to git's gitweb, and introducing new ones.\n>\n> Which of those should be implemented first?\n\nClean-ups and obvious fixes without introducing new features\nfirst please.\n\n> * Add (of course optional, like blame support) snapshot support. There are\n>   at least two different implementations. I'd prefer to do without second\n>   CGI script, but perhaps this is better from the performance point of view.\n>   gitweb-xmms2 has snapshot.cgi in Python: should it be rewritten in Perl?\n\nIsn't it just the matter of spawning git-tar-tree?\n\n> * gitweb-xmms2 has something called committags support: it means that\n>   'BUG(n)', 'FEATURE(n)' and 'RELEASE: xx' in commit message are turned into\n>   bugtracker (Mantis for xmms2) or wiki links. It is extension of turning\n>   sha1-ids into references. Probably needs some extra configuration file,\n>   and some per repository configuration. Of course we want to support not\n>   only Mantis, but also e.g. Bugzilla (e.g. Linux kernel) and conventions\n>   for marking bugs therein.\n\nYes, I found this quite nice.\n\nBTW, are you in touch with xmms2 folks?\n"},{"id":"22159","messageId":"e79jtd$51j$1@sea.gmane.org","threadId":"4592","inReplyTo":"46a038f90606201233p6283febbn9a46e36c3a666903@mail.gmail.com","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-20T19:56:34Z","receivedAt":"2006-06-20T19:56:34Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Martin Langhoff wrote:\n\n> On 6/21/06, Jakub Narebski <jnareb@gmail.com> wrote:\n>> \n>> * Add (of course optional, like blame support) snapshot support. There are\n>>   at least two different implementations. I'd prefer to do without second\n>>   CGI script, but perhaps this is better from the performance point of view.\n>>   gitweb-xmms2 has snapshot.cgi in Python: should it be rewritten in Perl?\n> \n> I intend to post a patch that adds snapshot support in Perl, in the\n> main code. Just need to make it optional ;-)\n\nCheck http://marc.theaimsgroup.com/?l=git&m=111909432415478&w=2 for \nin the main code snapshot implementation.\n\nhttp://www.liacs.nl/~sverdool/gitweb.cgi?p=gitweb.git;a=summary\nhttp://www.liacs.nl/~sverdool/gitweb.git\n\nWould separate snapshot CGI script make it work faster?\n\n>> Any further ideas for other useful features?\n> \n> Now what I think would rock too is something similar to gitk's \"nearby\n> tags\" feature. When reading a commit, it lists the heads and tags that\n> this commit is part of. It's very useful. Now I'll have to read up on\n> how gitk does it.\n\nIf I remember correctly, it was done in the background, and it was done \nat least partially _in_ gitk (Tcl/Tk).\n \n> And, as you mention in your other post, mod_perl support. And a bit of\n> speed. Gitweb right now is really really slow.\n\nPerhaps mod_cache would help. Especially if cache can be configured to \nlook only at the hash part, plus formatting (normal, plain/raw, blame,\nsearch match highlighting).\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22160","messageId":"20060620201035.GT2609@pasky.or.cz","threadId":"4592","inReplyTo":"e79921$u0e$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-06-20T20:10:35Z","receivedAt":"2006-06-20T20:10:35Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Tue, Jun 20, 2006 at 06:51:18PM CEST, I got a letter\nwhere Jakub Narebski <jnareb@gmail.com> said that...\n> * Add git fetch URL to the project page from gitweb-xmms2. Needs site-wide\n>   base_url, which need not to be set as there is sane default: use base \n>   of gitweb URL.\n> \n>   Is it useful to allow repository configuration to override it?\n\nCertainly. E.g. http://pasky.or.cz/gitweb.cgi hosts some random projects\nbut generally they are to be fetched from totally different locations.\n\n> * Refactor dispatch from if...elsif...else construction \n>   to using 'name' => \\&sub hash.\n\nIn other words, you say the result of the IRC discussion we had about\nsymbol lookups and evals turned out really scary? ;-)\n\n> * gitweb-xmms2 has something called committags support: it means that\n>   'BUG(n)', 'FEATURE(n)' and 'RELEASE: xx' in commit message are turned into\n>   bugtracker (Mantis for xmms2) or wiki links. It is extension of turning\n>   sha1-ids into references. Probably needs some extra configuration file,\n>   and some per repository configuration. Of course we want to support not\n>   only Mantis, but also e.g. Bugzilla (e.g. Linux kernel) and conventions\n>   for marking bugs therein.\n\nFor Bugzilla, just /\\bbug (\\d+)/i is frequently used so many people are\nprobably used to it while it feels natural and doesn't make you tumble\nover it when reading the message.\n\nFor these things it's simplest to give the user ability to specify some\nregexp substitutions to be applied on commit messages.\n\nAbout sha1 turned to references, I don't think that's practical until\nyou will have some way of finding out whether a given sha1 is a valid\nobject reference without Theta(n) forks.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nA person is just about as big as the things that make them angry.\n"},{"id":"22162","messageId":"e79njs$hue$1@sea.gmane.org","threadId":"4592","inReplyTo":"20060620201035.GT2609@pasky.or.cz","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-20T20:59:46Z","receivedAt":"2006-06-20T20:59:46Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Petr Baudis wrote:\n\n> Dear diary, on Tue, Jun 20, 2006 at 06:51:18PM CEST, I got a letter\n> where Jakub Narebski <jnareb@gmail.com> said that...\n\n>> * Refactor dispatch from if...elsif...else construction \n>>   to using 'name' => \\&sub hash.\n> \n> In other words, you say the result of the IRC discussion we had about\n> symbol lookups and evals turned out really scary? ;-)\n\nFirst, we need arrays (ordering!) of sets of possible actions for navbar,\nso we will have list of all possible actions.\n\nBesides, simple test\n\n        [...]\n        sub dispatch {\n          dispatch_ifelse(@_);\n          #dispatch_hash(@_);\n          #dispatch_callname(@_);\n          #dispatch_anonsub(@_);\n        }\n        \n        sub test_dispatch_all {\n          dispatch(undef);\n        \n          dispatch(\"summary\");\n          [...]\n          dispatch(\"tag\");\n                \n          dispatch(\"unknown\");\n          dispatch(\"tag();injected();\");\n        }\n        \n        test_dispatch_all() foreach (1..10000);\n\nrun with '$ time ./test.pl > /dev/null' has shown that (suprise, suprise!)\nthat hash is fastest, then if...elsif...else variant, then \n  my $sub = \\&{\"git_$action\"}; eval { &$sub() };\nand last, much much worse is eval \"...\" version.\n\nOf course test leaves something to be desired...\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22163","messageId":"46a038f90606201417k71c4c43ak59204774bcfe8246@mail.gmail.com","threadId":"4592","inReplyTo":"e79jtd$51j$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-06-20T21:17:56Z","receivedAt":"2006-06-20T21:17:56Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 6/21/06, Jakub Narebski <jnareb@gmail.com> wrote:\n> > I intend to post a patch that adds snapshot support in Perl, in the\n> > main code. Just need to make it optional ;-)\n>\n> Check http://marc.theaimsgroup.com/?l=git&m=111909432415478&w=2 for\n> in the main code snapshot implementation.\n>\n> http://www.liacs.nl/~sverdool/gitweb.cgi?p=gitweb.git;a=summary\n> http://www.liacs.nl/~sverdool/gitweb.git\n>\n> Would separate snapshot CGI script make it work faster?\n\nI was thinking about that same one, we found (and fixed) a bug or two\non top of that so my plan is to rebase it on top of the gitweb on next\n;-)\n\n> >> Any further ideas for other useful features?\n> >\n> > Now what I think would rock too is something similar to gitk's \"nearby\n> > tags\" feature. When reading a commit, it lists the heads and tags that\n> > this commit is part of. It's very useful. Now I'll have to read up on\n> > how gitk does it.\n>\n> If I remember correctly, it was done in the background, and it was done\n> at least partially _in_ gitk (Tcl/Tk).\n\nI suspect it is doing a whole lot of git-merge-base invocations, which\nare rather costly. I don't know of any cheaper way to ask that\nquestion.\n\n> > And, as you mention in your other post, mod_perl support. And a bit of\n> > speed. Gitweb right now is really really slow.\n>\n> Perhaps mod_cache would help. Especially if cache can be configured to\n> look only at the hash part, plus formatting (normal, plain/raw, blame,\n> search match highlighting).\n\nRight, some URLs are guaranteed to be static (those blob views), so it\ncan just cache on the full URL, for ever and ever. The other ones...\nwell, we just make sure we don't do anything too expensive there ;-)\n\n\n\nmartin\n"},{"id":"22164","messageId":"20060620212500.GU2609@pasky.or.cz","threadId":"4592","inReplyTo":"e79921$u0e$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-06-20T21:25:01Z","receivedAt":"2006-06-20T21:25:01Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"> Any further ideas for other useful features?\n\nBy the way, it would definitely make me feel better about gitweb\nsecurity-wise if it would run with taints checks on - they are very good\nidea.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nA person is just about as big as the things that make them angry.\n"},{"id":"22169","messageId":"20060620215331.GB25183@cip.informatik.uni-erlangen.de","threadId":"4592","inReplyTo":"e79921$u0e$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Thomas Glanzmann","fromEmail":"sithglan@stud.uni-erlangen.de","sentAt":"2006-06-20T21:53:31Z","receivedAt":"2006-06-20T21:53:31Z","isPatch":false,"sender":{"key":"sithglan@stud.uni-erlangen.de","avatar":null},"body":"Hello,\n\n> Any further ideas for other useful features?\n\na friend of mine was yesterday complained to me about not be able to see\nwhich file was last touched in a given directory like it is possible\nwith viewcvs[1]. I told him that he should just call 'git whatchanged\n-p'. And he answered back 'downloading 128Mbytes' for a few bytes\nof history? I told him to address this list with his feature request, but\nhe didn't do so far. So I use this opportunity. Maybe something else\nwould be much more handier: Use gitweb to request the log and shortlog\nof a directory tree, like git-whatchanged arch/i386 does for example.\nMaybe it is already possible and I missed it?\n\n        Thomas\n\n[1] viewcvs prints the last touch of a a file in a directory and you can\ntell it to sort after the date criteria:\n\nhttp://faumachine.informatik.uni-erlangen.de/cgi-bin/viewcvs.cgi/mutt/?sortby=date#dirlist\n"},{"id":"22178","messageId":"200606211056.10889.Josef.Weidendorfer@gmx.de","threadId":"4592","inReplyTo":"20060620215331.GB25183@cip.informatik.uni-erlangen.de","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-06-21T08:56:10Z","receivedAt":"2006-06-21T08:56:10Z","isPatch":false,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Tuesday 20 June 2006 23:53, you wrote:\n> he didn't do so far. So I use this opportunity. Maybe something else\n> would be much more handier: Use gitweb to request the log and shortlog\n> of a directory tree, like git-whatchanged arch/i386 does for example.\n> Maybe it is already possible and I missed it?\n\nThere aren't any links, but:\nOn the bottom of a commit, you can click on \"history\" for blobs.\nChanging the URL afterwards (the f= arg) can give you the history of\na directory.\n\nI just tried, and in fact it works. But \"Diff to current\" does not\nwork for directories.\n\nIt would be nice to have a list of the files in the directory\ntouched by the given commits.\n\nJosef\n"},{"id":"22182","messageId":"e7b2n4$hd8$1@sea.gmane.org","threadId":"4592","inReplyTo":"200606211056.10889.Josef.Weidendorfer@gmx.de","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T09:15:25Z","receivedAt":"2006-06-21T09:15:25Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Josef Weidendorfer wrote:\n\n> It would be nice to have a list of the files in the directory\n> touched by the given commits.\n\n'commit' view gives at the bottom list of all files affected by given\ncommit. Is that what you wanted, or did you want 'blame' for directories\n(trees)?\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22187","messageId":"200606211157.23809.Josef.Weidendorfer@gmx.de","threadId":"4592","inReplyTo":"e7b2n4$hd8$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-06-21T09:57:23Z","receivedAt":"2006-06-21T09:57:23Z","isPatch":false,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Wednesday 21 June 2006 11:15, you wrote:\n> Josef Weidendorfer wrote:\n> \n> > It would be nice to have a list of the files in the directory\n> > touched by the given commits.\n> \n> 'commit' view gives at the bottom list of all files affected by given\n> commit.\n\nYup, but when you are interested in the history of changes to files in\na given directory, you also want to see the name of the changed files on\nthe same page, and not have to click on every commit to get the file names.\nBesides, the \"commit\" view shows all changed files, and not only the ones\nwhich are in the directory.\n\n> Is that what you wanted, or did you want 'blame' for directories \n> (trees)?\n\nCould be interesting; but everytime I look at such a page in ViewCVS,\nI want to have it sorted by time...\n\nJosef\n"},{"id":"22203","messageId":"20060621130535.G2b34d382@leonov.stosberg.net","threadId":"4592","inReplyTo":"46a038f90606201233p6283febbn9a46e36c3a666903@mail.gmail.com","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-21T13:05:35Z","receivedAt":"2006-06-21T13:05:35Z","isPatch":false,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Martin Langhoff wrote:\n\n> And, as you mention in your other post, mod_perl support. And a bit of\n> speed. Gitweb rght now is really really slow.\n\nA few days ago I have tried to run gitweb under mod_perl and these\nare my results.  All of this hasn't got any real testing, so this is\nmore a request for comment.  I had to make two changes to gitweb to\nget it running as a Registry script with mod_perl:\n\n(1) With mod_perl you cannot access variables which were defined\n    with \"my\" on file scope from subroutines.  Unless gitweb becomes\n    split in separate packages the easiest solution is probably to\n    use \"our\" to declare them.\n\n(2) Setting %ENV has no effect on spawned processes under mod_perl,\n    so the git commands would never find the project directories.\n    My first thought was to set $GIT_DIR on the commands' command\n    lines like in open($fh, '$GIT_DIR=blah git-rev-list ...') but it\n    would lead to an extra shell being spawned on every invocation\n    of a git command.\n\n    So I added the possibility to set/override the path to the\n    repository with a command line parameter.  For simplicity I\n    handled that parameter in git.c.  The drawbacks are that it has\n    to be given before the command name and that it won't work when\n    commands are invoked as \"git-command\".\n\nThe gains vary hugely.  Inexpensive views like the title page, blob\nand commit view are sped up by a factor of 5 to 8 for successive\nrequests.  The project summary in contrast issues quite a number of\ncalls to git, so the speedup is only a few percent for it.\n\nRegards,\nDennis\n"},{"id":"22204","messageId":"20060621130708.Gcbc6e5c@leonov.stosberg.net","threadId":"4592","inReplyTo":"20060621130535.G2b34d382@leonov.stosberg.net","subject":"[PATCH 1/3] gitweb: Declare global variables with \"our\"","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-21T13:07:08Z","receivedAt":"2006-06-21T13:07:08Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Variables declared with \"my\" in the file scope cannot be accessed from\nsubroutines with mod_perl.\n---\n gitweb/gitweb.cgi |   55 ++++++++++++++++++++++++++---------------------------\n 1 files changed, 27 insertions(+), 28 deletions(-)\n\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex ef7fcbd..8f19fdb 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -16,21 +16,21 @@ use Encode;\n use Fcntl ':mode';\n binmode STDOUT, ':utf8';\n \n-my $cgi = new CGI;\n-my $version = \"267\";\n-my $my_url = $cgi->url();\n-my $my_uri = $cgi->url(-absolute => 1);\n-my $rss_link = \"\";\n+our $cgi = new CGI;\n+our $version = \"267\";\n+our $my_url = $cgi->url();\n+our $my_uri = $cgi->url(-absolute => 1);\n+our $rss_link = \"\";\n \n # location of the git-core binaries\n-my $gitbin = \"/usr/bin\";\n+our $gitbin = \"/usr/bin\";\n \n # absolute fs-path which will be prepended to the project path\n-#my $projectroot = \"/pub/scm\";\n-my $projectroot = \"/home/kay/public_html/pub/scm\";\n+#our $projectroot = \"/pub/scm\";\n+our $projectroot = \"/home/kay/public_html/pub/scm\";\n \n # version of the git-core binaries\n-my $git_version = qx($gitbin/git --version);\n+our $git_version = qx($gitbin/git --version);\n if ($git_version =~ m/git version (.*)$/) {\n \t$git_version = $1;\n } else {\n@@ -38,32 +38,31 @@ if ($git_version =~ m/git version (.*)$/\n }\n \n # location for temporary files needed for diffs\n-my $git_temp = \"/tmp/gitweb\";\n+our $git_temp = \"/tmp/gitweb\";\n \n # target of the home link on top of all pages\n-my $home_link = $my_uri;\n+our $home_link = $my_uri;\n \n # html text to include at home page\n-my $home_text = \"indextext.html\";\n+our $home_text = \"indextext.html\";\n \n # URI of default stylesheet\n-my $stylesheet = \"gitweb.css\";\n+our $stylesheet = \"gitweb.css\";\n \n # source of projects list\n-#my $projects_list = $projectroot;\n-my $projects_list = \"index/index.aux\";\n+#our $projects_list = $projectroot;\n+our $projects_list = \"index/index.aux\";\n \n # default blob_plain mimetype and default charset for text/plain blob\n-my $default_blob_plain_mimetype = 'text/plain';\n-my $default_text_plain_charset  = undef;\n+our $default_blob_plain_mimetype = 'text/plain';\n+our $default_text_plain_charset  = undef;\n \n # file to use for guessing MIME types before trying /etc/mime.types\n # (relative to the current git repository)\n-my $mimetypes_file = undef;\n-\n+our $mimetypes_file = undef;\n \n # input validation and dispatch\n-my $action = $cgi->param('a');\n+our $action = $cgi->param('a');\n if (defined $action) {\n \tif ($action =~ m/[^0-9a-zA-Z\\.\\-_]/) {\n \t\tundef $action;\n@@ -78,7 +77,7 @@ if (defined $action) {\n \t}\n }\n \n-my $order = $cgi->param('o');\n+our $order = $cgi->param('o');\n if (defined $order) {\n \tif ($order =~ m/[^0-9a-zA-Z_]/) {\n \t\tundef $order;\n@@ -86,7 +85,7 @@ if (defined $order) {\n \t}\n }\n \n-my $project = $cgi->param('p');\n+our $project = $cgi->param('p');\n if (defined $project) {\n \t$project = validate_input($project);\n \tif (!defined($project)) {\n@@ -108,7 +107,7 @@ if (defined $project) {\n \texit;\n }\n \n-my $file_name = $cgi->param('f');\n+our $file_name = $cgi->param('f');\n if (defined $file_name) {\n \t$file_name = validate_input($file_name);\n \tif (!defined($file_name)) {\n@@ -116,7 +115,7 @@ if (defined $file_name) {\n \t}\n }\n \n-my $hash = $cgi->param('h');\n+our $hash = $cgi->param('h');\n if (defined $hash) {\n \t$hash = validate_input($hash);\n \tif (!defined($hash)) {\n@@ -124,7 +123,7 @@ if (defined $hash) {\n \t}\n }\n \n-my $hash_parent = $cgi->param('hp');\n+our $hash_parent = $cgi->param('hp');\n if (defined $hash_parent) {\n \t$hash_parent = validate_input($hash_parent);\n \tif (!defined($hash_parent)) {\n@@ -132,7 +131,7 @@ if (defined $hash_parent) {\n \t}\n }\n \n-my $hash_base = $cgi->param('hb');\n+our $hash_base = $cgi->param('hb');\n if (defined $hash_base) {\n \t$hash_base = validate_input($hash_base);\n \tif (!defined($hash_base)) {\n@@ -140,7 +139,7 @@ if (defined $hash_base) {\n \t}\n }\n \n-my $page = $cgi->param('pg');\n+our $page = $cgi->param('pg');\n if (defined $page) {\n \tif ($page =~ m/[^0-9]$/) {\n \t\tundef $page;\n@@ -148,7 +147,7 @@ if (defined $page) {\n \t}\n }\n \n-my $searchtext = $cgi->param('s');\n+our $searchtext = $cgi->param('s');\n if (defined $searchtext) {\n \tif ($searchtext =~ m/[^a-zA-Z0-9_\\.\\/\\-\\+\\:\\@ ]/) {\n \t\tundef $searchtext;\n-- \n1.4.0\n"},{"id":"22205","messageId":"20060621130802.G53392da4@leonov.stosberg.net","threadId":"4592","inReplyTo":"20060621130535.G2b34d382@leonov.stosberg.net","subject":"[PATCH 2/3] Add a parameter to specify the repository path","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-21T13:08:03Z","receivedAt":"2006-06-21T13:08:03Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"---\n builtin-help.c |    2 +-\n git.c          |    6 ++++++\n 2 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-help.c b/builtin-help.c\nindex 7470faa..db233eb 100644\n--- a/builtin-help.c\n+++ b/builtin-help.c\n@@ -10,7 +10,7 @@ #include \"exec_cmd.h\"\n #include \"common-cmds.h\"\n \n static const char git_usage[] =\n-\t\"Usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--help] COMMAND [ ARGS ]\";\n+\t\"Usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--git-dir=GIT_DIR] [--help] COMMAND [ ARGS ]\";\n \n /* most gui terms set COLUMNS (although some don't export it) */\n static int term_columns(void)\ndiff --git a/git.c b/git.c\nindex 94e9a4a..d49f626 100644\n--- a/git.c\n+++ b/git.c\n@@ -277,6 +277,12 @@ int main(int argc, const char **argv, ch\n \t\t\tputs(git_exec_path());\n \t\t\texit(0);\n \t\t}\n+\n+\t\tif (!strncmp(cmd, \"git-dir=\", 8)) {\n+\t\t\tsetenv(\"GIT_DIR\", cmd + 8, 1);\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tcmd_usage(0, NULL, NULL);\n \t}\n \targv[0] = cmd;\n-- \n1.4.0\n"},{"id":"22206","messageId":"20060621130930.G421234bb@leonov.stosberg.net","threadId":"4592","inReplyTo":"20060621130535.G2b34d382@leonov.stosberg.net","subject":"[PATCH 3/3] gitweb: Use --git-dir parameter instead of setting $ENV{'GIT_DIR'}","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-21T13:09:30Z","receivedAt":"2006-06-21T13:09:30Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"---\n gitweb/gitweb.cgi |   67 +++++++++++++++++++++++++++--------------------------\n 1 files changed, 34 insertions(+), 33 deletions(-)\n\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex 8f19fdb..57ac3a3 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -61,6 +61,9 @@ # file to use for guessing MIME types be\n # (relative to the current git repository)\n our $mimetypes_file = undef;\n \n+# path to the project's repository\n+our $git_dir = undef;\n+\n # input validation and dispatch\n our $action = $cgi->param('a');\n if (defined $action) {\n@@ -101,7 +104,7 @@ if (defined $project) {\n \t}\n \t$rss_link = \"<link rel=\\\"alternate\\\" title=\\\"\" . esc_param($project) . \" log\\\" href=\\\"\" .\n \t\t    \"$my_uri?\" . esc_param(\"p=$project;a=rss\") . \"\\\" type=\\\"application/rss+xml\\\"/>\";\n-\t$ENV{'GIT_DIR'} = \"$projectroot/$project\";\n+\t$git_dir = \"$projectroot/$project\";\n } else {\n \tgit_project_list();\n \texit;\n@@ -372,7 +375,7 @@ sub die_error {\n sub git_get_type {\n \tmy $hash = shift;\n \n-\topen my $fd, \"-|\", \"$gitbin/git-cat-file -t $hash\" or return;\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir cat-file -t $hash\" or return;\n \tmy $type = <$fd>;\n \tclose $fd or return;\n \tchomp $type;\n@@ -381,19 +384,15 @@ sub git_get_type {\n \n sub git_read_head {\n \tmy $project = shift;\n-\tmy $oENV = $ENV{'GIT_DIR'};\n \tmy $retval = undef;\n-\t$ENV{'GIT_DIR'} = \"$projectroot/$project\";\n-\tif (open my $fd, \"-|\", \"$gitbin/git-rev-parse\", \"--verify\", \"HEAD\") {\n+\n+\tif (open my $fd, \"-|\", \"$gitbin/git\", \"--git-dir=$projectroot/$project\", \"rev-parse\", \"--verify\", \"HEAD\") {\n \t\tmy $head = <$fd>;\n \t\tclose $fd;\n \t\tif (defined $head && $head =~ /^([0-9a-fA-F]{40})$/) {\n \t\t\t$retval = $1;\n \t\t}\n \t}\n-\tif (defined $oENV) {\n-\t\t$ENV{'GIT_DIR'} = $oENV;\n-\t}\n \treturn $retval;\n }\n \n@@ -424,7 +423,7 @@ sub git_read_tag {\n \tmy %tag;\n \tmy @comment;\n \n-\topen my $fd, \"-|\", \"$gitbin/git-cat-file tag $tag_id\" or return;\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir cat-file tag $tag_id\" or return;\n \t$tag{'id'} = $tag_id;\n \twhile (my $line = <$fd>) {\n \t\tchomp $line;\n@@ -496,7 +495,7 @@ sub git_read_commit {\n \t\t@commit_lines = @$commit_text;\n \t} else {\n \t\t$/ = \"\\0\";\n-\t\topen my $fd, \"-|\", \"$gitbin/git-rev-list --header --parents --max-count=1 $commit_id\" or return;\n+\t\topen my $fd, \"-|\", \"$gitbin/git  --git-dir=$git_dir rev-list --header --parents --max-count=1 $commit_id\" or return;\n \t\t@commit_lines = split '\\n', <$fd>;\n \t\tclose $fd or return;\n \t\t$/ = \"\\n\";\n@@ -594,7 +593,7 @@ sub git_diff_print {\n \tif (defined $from) {\n \t\t$from_tmp = \"$git_temp/gitweb_\" . $$ . \"_from\";\n \t\topen my $fd2, \"> $from_tmp\";\n-\t\topen my $fd, \"-|\", \"$gitbin/git-cat-file blob $from\";\n+\t\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir cat-file blob $from\";\n \t\tmy @file = <$fd>;\n \t\tprint $fd2 @file;\n \t\tclose $fd2;\n@@ -605,7 +604,7 @@ sub git_diff_print {\n \tif (defined $to) {\n \t\t$to_tmp = \"$git_temp/gitweb_\" . $$ . \"_to\";\n \t\topen my $fd2, \"> $to_tmp\";\n-\t\topen my $fd, \"-|\", \"$gitbin/git-cat-file blob $to\";\n+\t\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir cat-file blob $to\";\n \t\tmy @file = <$fd>;\n \t\tprint $fd2 @file;\n \t\tclose $fd2;\n@@ -844,10 +843,12 @@ sub git_project_list {\n \t}\n \tforeach my $pr (@list) {\n \t\tmy $head = git_read_head($pr->{'path'});\n+\t\tprint STDERR $head;\n+\n \t\tif (!defined $head) {\n \t\t\tnext;\n \t\t}\n-\t\t$ENV{'GIT_DIR'} = \"$projectroot/$pr->{'path'}\";\n+\t\t$git_dir = \"$projectroot/$pr->{'path'}\";\n \t\tmy %co = git_read_commit($head);\n \t\tif (!%co) {\n \t\t\tnext;\n@@ -1046,7 +1047,7 @@ sub git_summary {\n \t      \"<tr><td>owner</td><td>$owner</td></tr>\\n\" .\n \t      \"<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\\n\" .\n \t      \"</table>\\n\";\n-\topen my $fd, \"-|\", \"$gitbin/git-rev-list --max-count=17 \" . git_read_head($project) or die_error(undef, \"Open failed.\");\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir rev-list --max-count=17 \" . git_read_head($project) or die_error(undef, \"Open failed.\");\n \tmy (@revlist) = map { chomp; $_ } <$fd>;\n \tclose $fd;\n \tprint \"<div>\\n\" .\n@@ -1224,7 +1225,7 @@ sub git_tag {\n \n sub git_blame {\n \tmy $fd;\n-\tdie_error('403 Permission denied', \"Permission denied.\") if (!git_get_project_config_bool ('blame'));\n+\t#die_error('403 Permission denied', \"Permission denied.\") if (!git_get_project_config_bool ('blame'));\n \tdie_error('404 Not Found', \"What file will it be, master?\") if (!$file_name);\n \t$hash_base ||= git_read_head($project);\n \tdie_error(undef, \"Reading commit failed.\") unless ($hash_base);\n@@ -1234,7 +1235,7 @@ sub git_blame {\n \t\t$hash = git_get_hash_by_path($hash_base, $file_name, \"blob\")\n \t\t\tor die_error(undef, \"Error lookup file.\");\n \t}\n-\topen ($fd, \"-|\", \"$gitbin/git-annotate\", '-l', '-t', '-r', $file_name, $hash_base)\n+\topen ($fd, \"-|\", \"$gitbin/git\", \"--git-dir=$git_dir\", \"annotate\", '-l', '-t', '-r', $file_name, $hash_base)\n \t\tor die_error(undef, \"Open failed.\");\n \tgit_header_html();\n \tprint \"<div class=\\\"page_nav\\\">\\n\" .\n@@ -1429,7 +1430,7 @@ sub git_get_hash_by_path {\n \tmy $tree = $base;\n \tmy @parts = split '/', $path;\n \twhile (my $part = shift @parts) {\n-\t\topen my $fd, \"-|\", \"$gitbin/git-ls-tree $tree\" or die_error(undef, \"Open git-ls-tree failed.\");\n+\t\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir ls-tree $tree\" or die_error(undef, \"Open git-ls-tree failed.\");\n \t\tmy (@entries) = map { chomp; $_ } <$fd>;\n \t\tclose $fd or return undef;\n \t\tforeach my $line (@entries) {\n@@ -1457,8 +1458,8 @@ sub git_blob {\n \t\tmy $base = $hash_base || git_read_head($project);\n \t\t$hash = git_get_hash_by_path($base, $file_name, \"blob\") || die_error(undef, \"Error lookup file.\");\n \t}\n-\tmy $have_blame = git_get_project_config_bool ('blame');\n-\topen my $fd, \"-|\", \"$gitbin/git-cat-file blob $hash\" or die_error(undef, \"Open failed.\");\n+\tmy $have_blame = 1; #git_get_project_config_bool ('blame');\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir cat-file blob $hash\" or die_error(undef, \"Open failed.\");\n \tgit_header_html();\n \tif (defined $hash_base && (my %co = git_read_commit($hash_base))) {\n \t\tprint \"<div class=\\\"page_nav\\\">\\n\" .\n@@ -1570,7 +1571,7 @@ sub git_blob_plain_mimetype {\n }\n \n sub git_blob_plain {\n-\topen my $fd, \"-|\", \"$gitbin/git-cat-file blob $hash\" or return;\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir cat-file blob $hash\" or return;\n \tmy $type = git_blob_plain_mimetype($fd, $file_name);\n \n \t# save as filename, even when no $file_name is given\n@@ -1602,7 +1603,7 @@ sub git_tree {\n \t\t}\n \t}\n \t$/ = \"\\0\";\n-\topen my $fd, \"-|\", \"$gitbin/git-ls-tree -z $hash\" or die_error(undef, \"Open git-ls-tree failed.\");\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir ls-tree -z $hash\" or die_error(undef, \"Open git-ls-tree failed.\");\n \tchomp (my (@entries) = <$fd>);\n \tclose $fd or die_error(undef, \"Reading tree failed.\");\n \t$/ = \"\\n\";\n@@ -1683,7 +1684,7 @@ #\t\t\t      \" | \" . $cgi->a({-href => \"$my\n \n sub git_rss {\n \t# http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ\n-\topen my $fd, \"-|\", \"$gitbin/git-rev-list --max-count=150 \" . git_read_head($project) or die_error(undef, \"Open failed.\");\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir rev-list --max-count=150 \" . git_read_head($project) or die_error(undef, \"Open failed.\");\n \tmy (@revlist) = map { chomp; $_ } <$fd>;\n \tclose $fd or die_error(undef, \"Reading rev-list failed.\");\n \tprint $cgi->header(-type => 'text/xml', -charset => 'utf-8');\n@@ -1703,7 +1704,7 @@ sub git_rss {\n \t\t\tlast;\n \t\t}\n \t\tmy %cd = date_str($co{'committer_epoch'});\n-\t\topen $fd, \"-|\", \"$gitbin/git-diff-tree -r $co{'parent'} $co{'id'}\" or next;\n+\t\topen $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir diff-tree -r $co{'parent'} $co{'id'}\" or next;\n \t\tmy @difftree = map { chomp; $_ } <$fd>;\n \t\tclose $fd or next;\n \t\tprint \"<item>\\n\" .\n@@ -1756,7 +1757,7 @@ sub git_opml {\n \t\tif (!defined $head) {\n \t\t\tnext;\n \t\t}\n-\t\t$ENV{'GIT_DIR'} = \"$projectroot/$proj{'path'}\";\n+\t\t$git_dir = \"$projectroot/$proj{'path'}\";\n \t\tmy %co = git_read_commit($head);\n \t\tif (!%co) {\n \t\t\tnext;\n@@ -1791,7 +1792,7 @@ sub git_log {\n \t      \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=tree;h=$hash;hb=$hash\")}, \"tree\") . \"<br/>\\n\";\n \n \tmy $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n-\topen my $fd, \"-|\", \"$gitbin/git-rev-list $limit $hash\" or die_error(undef, \"Open failed.\");\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir rev-list $limit $hash\" or die_error(undef, \"Open failed.\");\n \tmy (@revlist) = map { chomp; $_ } <$fd>;\n \tclose $fd;\n \n@@ -1882,7 +1883,7 @@ sub git_commit {\n \t\t$root = \" --root\";\n \t\t$parent = \"\";\n \t}\n-\topen my $fd, \"-|\", \"$gitbin/git-diff-tree -r -M $root $parent $hash\" or die_error(undef, \"Open failed.\");\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir diff-tree -r -M $root $parent $hash\" or die_error(undef, \"Open failed.\");\n \t@difftree = map { chomp; $_ } <$fd>;\n \tclose $fd or die_error(undef, \"Reading diff-tree failed.\");\n \n@@ -2124,7 +2125,7 @@ sub git_commitdiff {\n \tif (!defined $hash_parent) {\n \t\t$hash_parent = $co{'parent'};\n \t}\n-\topen my $fd, \"-|\", \"$gitbin/git-diff-tree -r $hash_parent $hash\" or die_error(undef, \"Open failed.\");\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir diff-tree -r $hash_parent $hash\" or die_error(undef, \"Open failed.\");\n \tmy (@difftree) = map { chomp; $_ } <$fd>;\n \tclose $fd or die_error(undef, \"Reading diff-tree failed.\");\n \n@@ -2214,14 +2215,14 @@ sub git_commitdiff {\n \n sub git_commitdiff_plain {\n \tmkdir($git_temp, 0700);\n-\topen my $fd, \"-|\", \"$gitbin/git-diff-tree -r $hash_parent $hash\" or die_error(undef, \"Open failed.\");\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir diff-tree -r $hash_parent $hash\" or die_error(undef, \"Open failed.\");\n \tmy (@difftree) = map { chomp; $_ } <$fd>;\n \tclose $fd or die_error(undef, \"Reading diff-tree failed.\");\n \n \t# try to figure out the next tag after this commit\n \tmy $tagname;\n \tmy $refs = read_info_ref(\"tags\");\n-\topen $fd, \"-|\", \"$gitbin/git-rev-list HEAD\";\n+\topen $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir rev-list HEAD\";\n \tchomp (my (@commits) = <$fd>);\n \tclose $fd;\n \tforeach my $commit (@commits) {\n@@ -2291,7 +2292,7 @@ sub git_history {\n \t      \"</div>\\n\";\n \tprint \"<div class=\\\"page_path\\\"><b>/\" . esc_html($file_name) . \"</b><br/></div>\\n\";\n \n-\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin -- \\'$file_name\\'\";\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir rev-list $hash | $gitbin/git --git-dir=$git_dir diff-tree -r --stdin -- \\'$file_name\\'\";\n \tmy $commit;\n \tprint \"<table cellspacing=\\\"0\\\">\\n\";\n \tmy $alternate = 0;\n@@ -2383,7 +2384,7 @@ sub git_search {\n \tmy $alternate = 0;\n \tif ($commit_search) {\n \t\t$/ = \"\\0\";\n-\t\topen my $fd, \"-|\", \"$gitbin/git-rev-list --header --parents $hash\" or next;\n+\t\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir rev-list --header --parents $hash\" or next;\n \t\twhile (my $commit_text = <$fd>) {\n \t\t\tif (!grep m/$searchtext/i, $commit_text) {\n \t\t\t\tnext;\n@@ -2433,7 +2434,7 @@ sub git_search {\n \n \tif ($pickaxe_search) {\n \t\t$/ = \"\\n\";\n-\t\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin -S\\'$searchtext\\'\";\n+\t\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir rev-list $hash | $gitbin/git --git-dir=$git_dir diff-tree -r --stdin -S\\'$searchtext\\'\";\n \t\tundef %co;\n \t\tmy @files;\n \t\twhile (my $line = <$fd>) {\n@@ -2504,7 +2505,7 @@ sub git_shortlog {\n \t      \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=tree;h=$hash;hb=$hash\")}, \"tree\") . \"<br/>\\n\";\n \n \tmy $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n-\topen my $fd, \"-|\", \"$gitbin/git-rev-list $limit $hash\" or die_error(undef, \"Open failed.\");\n+\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir rev-list $limit $hash\" or die_error(undef, \"Open failed.\");\n \tmy (@revlist) = map { chomp; $_ } <$fd>;\n \tclose $fd;\n \n-- \n1.4.0\n"},{"id":"22208","messageId":"e7bhlf$5j2$1@sea.gmane.org","threadId":"4592","inReplyTo":"20060621130535.G2b34d382@leonov.stosberg.net","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T13:30:32Z","receivedAt":"2006-06-21T13:30:32Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Dennis Stosberg wrote:\n\n> (2) Setting %ENV has no effect on spawned processes under mod_perl,\n>     so the git commands would never find the project directories.\n>     My first thought was to set $GIT_DIR on the commands' command\n>     lines like in open($fh, '$GIT_DIR=blah git-rev-list ...') but it\n>     would lead to an extra shell being spawned on every invocation\n>     of a git command.\n> \n>     So I added the possibility to set/override the path to the\n>     repository with a command line parameter.  For simplicity I\n>     handled that parameter in git.c.  The drawbacks are that it has\n>     to be given before the command name and that it won't work when\n>     commands are invoked as \"git-command\".\n\nSo now you have extra git redirector being spawned, instead of extra shell\nbeing spawned. I wonder if using 'env' wouldn't be simplier, and how\nportable 'env' is.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22209","messageId":"20060621163302.47271f89.tihirvon@gmail.com","threadId":"4592","inReplyTo":"20060621130930.G421234bb@leonov.stosberg.net","subject":"Re: [PATCH 3/3] gitweb: Use --git-dir parameter instead of setting $ENV{'GIT_DIR'}","fromName":"Timo Hirvonen","fromEmail":"tihirvon@gmail.com","sentAt":"2006-06-21T13:33:02Z","receivedAt":"2006-06-21T13:33:02Z","isPatch":true,"sender":{"key":"tihirvon@gmail.com","avatar":null},"body":"Dennis Stosberg <dennis@stosberg.net> wrote:\n\n> -\topen my $fd, \"-|\", \"$gitbin/git-cat-file -t $hash\" or return;\n> +\topen my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir cat-file -t $hash\" or return;\n\nHow about adding a function to simplify calling the git commands?\n\nSomething like git(\"cat-file -t $hash\") which would return\n\"$gitbin/git --git-dir=$git_dir cat-file -t $hash\" string.\n\nI'm not Perl programmer so I don't know what would be the best way to\ndo this.\n\n-- \nhttp://onion.dynserv.net/~timo/\n"},{"id":"22210","messageId":"e7bibt$7m0$1@sea.gmane.org","threadId":"4592","inReplyTo":"20060621163302.47271f89.tihirvon@gmail.com","subject":"Re: [PATCH 3/3] gitweb: Use --git-dir parameter instead of setting $ENV{'GIT_DIR'}","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T13:42:31Z","receivedAt":"2006-06-21T13:42:31Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Timo Hirvonen wrote:\n\n> Dennis Stosberg <dennis@stosberg.net> wrote:\n> \n>> -    open my $fd, \"-|\", \"$gitbin/git-cat-file -t $hash\" or return;\n>> +    open my $fd, \"-|\", \"$gitbin/git --git-dir=$git_dir cat-file -t $hash\" or return;\n> \n> How about adding a function to simplify calling the git commands?\n> \n> Something like git(\"cat-file -t $hash\") which would return\n> \"$gitbin/git --git-dir=$git_dir cat-file -t $hash\" string.\n\nOr rather add a function(s) to call git commands, either returning git command\noutput, or filehandle to read from, e.g.\n\n  my $fd = git_open(\"cat-file\", \"-t $hash\") or return; \n\ni.e. each parameter separately, just in case.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22211","messageId":"e7bj0s$b0p$1@sea.gmane.org","threadId":"4592","inReplyTo":"200606211157.23809.Josef.Weidendorfer@gmx.de","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T13:53:41Z","receivedAt":"2006-06-21T13:53:41Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Josef Weidendorfer wrote:\n\n> On Wednesday 21 June 2006 11:15, Jakub Narebski wrote:\n>> Josef Weidendorfer wrote:\n>> \n>>> It would be nice to have a list of the files in the directory\n>>> touched by the given commits.\n>> \n>> 'commit' view gives at the bottom list of all files affected by given\n>> commit.\n> \n> Yup, but when you are interested in the history of changes to files in\n> a given directory, you also want to see the name of the changed files on\n> the same page, and not have to click on every commit to get the file\n> names. Besides, the \"commit\" view shows all changed files, and not only \n> the ones which are in the directory.\n\nCould you please create a mockup how you imagine the page to look like\n(in ascii-art)? At least list the columns...\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22213","messageId":"e7bmfn$m7u$1@sea.gmane.org","threadId":"4592","inReplyTo":"20060620175505.GR2609@pasky.or.cz","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T14:52:49Z","receivedAt":"2006-06-21T14:52:49Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Petr Baudis wrote:\n\n> Nope, you get the stuff in $PATH_INFO. And having at least just the\n> project name in the path part would be quite nice, it's my common gripe\n> with cvsweb as I frequently get to mangle with the query part manually\n> (can be much faster than clicking around) and I have to carefully evade\n> the project name part, which is something I would really expect to be in\n> the \"static\" part of the URL.\n\nWhat about the patch I just sent:  \"[PATCH] gitweb: Make use of $PATH_INFO\nfor project parameter\" (<11509012742493-git-send-email-jnareb@gmail.com>)?\n\nIt doesn't as of yet make use of that.\n\nI wonder if this solution would work for mod_perl, or one would need some\nApache-specific package...\n\nP.S. I meant to sent the patch as reply to this mail. Oops.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22217","messageId":"200606211838.50864.jnareb@gmail.com","threadId":"4592","inReplyTo":"200606211802.41071.Josef.Weidendorfer@gmx.de","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T16:38:50Z","receivedAt":"2006-06-21T16:38:50Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Josef Weidendorfer wrote:\n> On Wednesday 21 June 2006 15:53, Jakub Narebski wrote:\n>>> Yup, but when you are interested in the history of changes to files in\n>>> a given directory, you also want to see the name of the changed files on\n>>> the same page, and not have to click on every commit to get the file\n>>> names. Besides, the \"commit\" view shows all changed files, and not only \n>>> the ones which are in the directory.\n>> \n>> Could you please create a mockup how you imagine the page to look like\n>> (in ascii-art)? At least list the columns...\n> \n> Let's see. A think a mixture between current history and log...\n> Currently, it looks like this\n> \n>  http://git.kernel.org/git/?p=git/git.git;a=history;f=Documentation\n> \n> gives you the history of subdirectory Documentation/ of git\n> (unfortunately only reachable via changing the URL...).\n> \n> And it could look as attached (I did a little copy/paste of\n> HTML). I only modified 2 commits of the list...\n\nIt probably didn't get to mailing list (at least to archives) due \nto having attachement.\n\nI thought you wanted to enhance tree view, e.g. adding to the view like in\n\n  http://git.kernel.org/git/?p=git/git.git;a=tree;f=Documentation\n\ncolumns 'Changed by' or 'Author', 'Age' or 'Last changed', 'Commit' \n(i.e. abbreviated sha1 id of a commit), and perhaps shortened commit\nmessage (short description of changes, a la shortlog but shorther).\nIn other words 'blame'/'annotate' for directory. Which would need new git\ncommand I think.\n\nAdding filtered list of files modified by commit in log and history views \nshould be fairly easy...\n-- \nJakub Narebski\nPoland\n"},{"id":"22218","messageId":"20060621164503.GA1285@h4x0r5.com","threadId":"4592","inReplyTo":"20060621130535.G2b34d382@leonov.stosberg.net","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2006-06-21T16:45:12Z","receivedAt":"2006-06-21T16:45:12Z","isPatch":false,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"On Wed, Jun 21, 2006 at 03:05:35PM +0200, Dennis Stosberg wrote:\n> (2) Setting %ENV has no effect on spawned processes under mod_perl,\n>     so the git commands would never find the project directories.\n>     My first thought was to set $GIT_DIR on the commands' command\n>     lines like in open($fh, '$GIT_DIR=blah git-rev-list ...') but it\n>     would lead to an extra shell being spawned on every invocation\n>     of a git command.\n\n\nI haven't looked at gitweb much, but why can't you solve this by doing\nmanual pipe,fork,exec combinations?  That should give you complete\ncontrol over the environment, right?\n\n(IIRC, the last time I played with mod_perl and spawning processes, I\nrecall it doing something very confusing with the pipes I had open.)\n\n\n-- \n\nRyan Anderson\n  sometimes Pug Majere\n"},{"id":"22219","messageId":"e7c034$1c1$1@sea.gmane.org","threadId":"4592","inReplyTo":"20060621164503.GA1285@h4x0r5.com","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T17:36:46Z","receivedAt":"2006-06-21T17:36:46Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Ryan Anderson wrote:\n\n> On Wed, Jun 21, 2006 at 03:05:35PM +0200, Dennis Stosberg wrote:\n>> (2) Setting %ENV has no effect on spawned processes under mod_perl,\n>>     so the git commands would never find the project directories.\n>>     My first thought was to set $GIT_DIR on the commands' command\n>>     lines like in open($fh, '$GIT_DIR=blah git-rev-list ...') but it\n>>     would lead to an extra shell being spawned on every invocation\n>>     of a git command.\n> \n> I haven't looked at gitweb much, but why can't you solve this by doing\n> manual pipe,fork,exec combinations?  That should give you complete\n> control over the environment, right?\n\nIn gitweb.cgi we now use magic open \"-|\" invocation, e.g.:\n\n        open my $fd, \"-|\", \"$gitbin/git-cat-file -t $hash\" or return;\n\nin git-rerere we still fork magically, but exec explicitely\n\n        my $pid = open($in, '-|');\n        die \"$!\" unless defined $pid;\n        if (!$pid) {\n                exec(qw(git ls-files -z -u)) or die \"$!: ls-files\";\n        }\n\nThe same is done in git-annotate (via open_pipe sub which takes care of\nActiveState Perl implementation); git-archimport, git-cvsexportcommit \n(via safe_pipe_capture); git-send-email (without encapsulating in \na subroutine; it also uses backticks)  \n\ngit-svn uses fork + redirecting output + exec and waitpid for quiet_run\nsubroutine and system call.\n\ngit-cvsimport uses system call, backticks, straight pipe open, i.e. using\n\"git-command |\", and magic open \"-|\" like gitweb.cgi. git-cvsserver has\nsafe_pipe_capture, but sometimes uses backticks. git-fmt-merge-message uses\nbackticks only. git-mv uses backticks and pipe. git-svnimport uses system\ncall and pipe.\n\nWhat a mess. We really need Git.pm module...\n\n\nAnd to answer your question, AFAICT exec cannot modify environment, not like\nexecve (or execle wrapper). POE (POE::Wheel::Run) or IPC::Run modules\nperhaps...\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22223","messageId":"200606212235.53586.Josef.Weidendorfer@gmx.de","threadId":"4592","inReplyTo":"200606211838.50864.jnareb@gmail.com","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-06-21T20:35:53Z","receivedAt":"2006-06-21T20:35:53Z","isPatch":false,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Wednesday 21 June 2006 18:38, you wrote:\n> Josef Weidendorfer wrote:\n> > Let's see. A think a mixture between current history and log...\n> > Currently, it looks like this\n> > \n> >  http://git.kernel.org/git/?p=git/git.git;a=history;f=Documentation\n> > \n> > gives you the history of subdirectory Documentation/ of git\n> > (unfortunately only reachable via changing the URL...).\n> > \n> > And it could look as attached (I did a little copy/paste of\n> > HTML). I only modified 2 commits of the list...\n> \n> It probably didn't get to mailing list (at least to archives) due \n> to having attachement.\n\nYes; the mailing list regarded as spam because of the attachment.\n\n> I thought you wanted to enhance tree view,\n\nThat wasn't me ;-)\n\n> e.g. adding to the view like in \n> \n>   http://git.kernel.org/git/?p=git/git.git;a=tree;f=Documentation\n> \n> columns 'Changed by' or 'Author', 'Age' or 'Last changed', 'Commit' \n> (i.e. abbreviated sha1 id of a commit), and perhaps shortened commit\n> message (short description of changes, a la shortlog but shorther).\n\nYes, sometimes this could be interesting. However, as said above,\nI find myself often looking for date sorting with such views.\n\n> In other words 'blame'/'annotate' for directory. Which would need new git\n> command I think.\n\nHmmm... wouldn't \"git-log --summary\", and building up a map from files names\nto commits be enough? You would probably need to parse the full history before\nsending any output, so it is potentially heavy. \n\n> Adding filtered list of files modified by commit in log and history views \n> should be fairly easy...\n\nYes. If I get some time, I'll send a patch.\n\nJosef\n"},{"id":"22249","messageId":"e7dm8g$mc9$1@sea.gmane.org","threadId":"4592","inReplyTo":"e79921$u0e$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-22T09:01:04Z","receivedAt":"2006-06-22T09:01:04Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jakub Narebski wrote:\n\n> I am planning on copying features from xmms2's gitweb version \n> to git's gitweb, and introducing new ones.\n\n> * Refactor generation of navigation bar. There are at least two\n>   implementations of that. With hash dispatch it would be easy to\n>   list all possibilities.\n\nActually I think that whole gitweb.cgi needs refactoring, badly. Generation\nof navigation bar is only one, admittedly worst, example of code\nduplication.\n\n\nAnother gitweb feature I can think of:\n\n* Add information about from which repository and which branch in the\n  remote repository given branch (head) came from. Should support both\n  $GIT_DIR/branches and $GIT_DIR/remotes format, and be easy extendable\n  to support branch/repo/remotes configuration in config.\n\n  I think it would be best to show this info (as it is variable long length,\n  and optional) as the last column of heads listing. Or would be better to\n  just add link with the remote name as text?\n\n  Is git://host.xz/path/to/repo.git#branch correct branch URI?\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22252","messageId":"7vu06dsgau.fsf@assigned-by-dhcp.cox.net","threadId":"4592","inReplyTo":"e7dm8g$mc9$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-22T09:14:33Z","receivedAt":"2006-06-22T09:14:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> Jakub Narebski wrote:\n>\n>> I am planning on copying features from xmms2's gitweb version \n>> to git's gitweb, and introducing new ones.\n>\n>> * Refactor generation of navigation bar. There are at least two\n>>   implementations of that. With hash dispatch it would be easy to\n>>   list all possibilities.\n>\n> Actually I think that whole gitweb.cgi needs refactoring, badly. Generation\n> of navigation bar is only one, admittedly worst, example of code\n> duplication.\n\nYes.  I liked what xmms2 folks did to the navbar exactly for\nthat reason.  We would be better off to first clean up what we\ncurrently have before starting to build too much on it.\n"},{"id":"22256","messageId":"20060622100024.G7f491d4a@leonov.stosberg.net","threadId":"4592","inReplyTo":"e7bhlf$5j2$1@sea.gmane.org","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-22T10:00:25Z","receivedAt":"2006-06-22T10:00:25Z","isPatch":false,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Jakub Narebski wrote:\n\n> So now you have extra git redirector being spawned, instead of extra shell\n> being spawned. \n\nMost of the commands that Gitweb uses are built-ins, so there\nshouldn't be any extra overhead by calling \"git command\" instead of\n\"git-command\".  If I haven't missed one, git-annotate is the only one\nwhich is not a built-in.\n\nRegards,\nDennis\n"},{"id":"22280","messageId":"20060622144725.GB3154@h4x0r5.com","threadId":"4592","inReplyTo":"20060622100024.G7f491d4a@leonov.stosberg.net","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2006-06-22T14:47:27Z","receivedAt":"2006-06-22T14:47:27Z","isPatch":false,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"On Thu, Jun 22, 2006 at 12:00:25PM +0200, Dennis Stosberg wrote:\n> Jakub Narebski wrote:\n> \n> > So now you have extra git redirector being spawned, instead of extra shell\n> > being spawned. \n> \n> Most of the commands that Gitweb uses are built-ins, so there\n> shouldn't be any extra overhead by calling \"git command\" instead of\n> \"git-command\".  If I haven't missed one, git-annotate is the only one\n> which is not a built-in.\n\ngit-annotate is a Perl script anyway, so it's not unreasonable to\nconsider making it a .pm module and just using it directly in gitweb.\n\n\n-- \n\nRyan Anderson\n  sometimes Pug Majere\n"},{"id":"22972","messageId":"17574.20488.149073.587594@cargo.ozlabs.ibm.com","threadId":"4592","inReplyTo":"46a038f90606201417k71c4c43ak59204774bcfe8246@mail.gmail.com","subject":"Re: [RFC] gitweb wishlist and TODO list","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2006-07-01T10:35:52Z","receivedAt":"2006-07-01T10:35:52Z","isPatch":false,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Martin Langhoff writes:\n\n> > If I remember correctly, it was done in the background, and it was done\n> > at least partially _in_ gitk (Tcl/Tk).\n> \n> I suspect it is doing a whole lot of git-merge-base invocations, which\n> are rather costly. I don't know of any cheaper way to ask that\n> question.\n\nThere's no git-merge-base involved.  Gitk does a\n\ngit-rev-list --all --topo-order --parents\n\nand reads the output of that, and then traverses the entire graph\nforwards and backwards (in Tcl).  (This is after gitk has read the\noutput of git ls-remote $GIT_DIR, so it knows which commits have\ntags.)\n\nPaul.\n"}]}