{"thread":{"id":"33410","subject":"git instaweb - share all project files","startedAt":"2013-04-07T03:02:10Z","lastAt":"2013-04-14T10:35:37Z","messageCount":6,"participants":["Trenton D. Adams","Jakub Narębski","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"213370","messageId":"CAMg8Y2pFXrbh8cz6m5z=LsksRijLVcV4fTk-TBx+9yaQTtAzpA@mail.gmail.com","threadId":"33410","inReplyTo":null,"subject":"git instaweb - share all project files","fromName":"Trenton D. Adams","fromEmail":"trenton.d.adams@gmail.com","sentAt":"2013-04-07T03:02:10Z","receivedAt":"2013-04-07T03:02:10Z","isPatch":false,"sender":{"key":"trenton.d.adams@gmail.com","avatar":null},"body":"Hello,\n\nOn that first page that shows up, it shows the .git folder.  It would\nbe kind of nice if it shared out both the git repo and the actual\ncurrent project files.  I frequently have stuff I'd like to see in a\nweb browser, and even requires one (i.e. Navigating to\nfile:///home/blah/blah doesn't work; ajax requests for example)\n\nThanks.\n"},{"id":"213788","messageId":"51659B5B.6000707@gmail.com","threadId":"33410","inReplyTo":"CAMg8Y2pFXrbh8cz6m5z=LsksRijLVcV4fTk-TBx+9yaQTtAzpA@mail.gmail.com","subject":"Re: git instaweb - share all project files","fromName":"Jakub Narębski","fromEmail":"jnareb@gmail.com","sentAt":"2013-04-10T17:03:23Z","receivedAt":"2013-04-10T17:03:23Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"W dniu 07.04.2013 05:02, Trenton D. Adams pisze:\n\n> On that first page that shows up, it shows the .git folder.  It would\n> be kind of nice if it shared out both the git repo and the actual\n> current project files.  I frequently have stuff I'd like to see in a\n> web browser, and even requires one (i.e. Navigating to\n> file:///home/blah/blah doesn't work; ajax requests for example)\n\nThere are a few possible solutions, from simplest to most complicated:\n\n1. Configure gitweb ran by git-instaweb to have 'worktree' link in\n   the action bar pointing to 'file:///path/to/repo' (or rather\n   'file:///path/to/workdir') via 'actions' feature, adding e.g.\n\n     $feature{'actions'}{'default'} =\n     \t[('worktree', 'file:///path/to/repo', 'summary')];\n\n   to gitweb_config.perl / gitweb.conf used by git-instaweb's gitweb.\n\n   This of course works only for local use, so either git-instaweb\n   or gitweb (in config) should check that we use it locally\n   (e.g. if hostname is 'localhost' or equivalent).\n\n2. In the web server configuration generated by git-instaweb, perhaps\n   as an option, add serving of worktree (with mod_autoindex aka.\n   'Options +Indexes' for Apache2, and equivalent solutions for *all*\n   other supported web servers: lighttpd, mongoose, plack, webrick).\n\n   This may require some fiddling with URI rewriting, or change of\n   gitweb URI, to be able to have both worktree index and gitweb\n   script (gitweb is now under '/'), so it should probably be protected\n   by an option to git-instaweb.\n\n3. Add proper support to gitweb: add 'worktree' action (similar to\n   'tree' action / view).  Probably needs to be made somewhat\n   configurable (and of course enabled in git-instaweb).\n\n\nUnfortunately solution 1.) which is simplest is not enough for your\nsituation...\n\nI can add 3.) to my gitweb TODO, but I don't know when I would be able\nto get to implementing it.\n-- \nJakub Narębski\n"},{"id":"213872","messageId":"CAMg8Y2qm9FuuMZh7jsAEyr=joUbsp=5V_zU5U86sW0Y=f2OVBA@mail.gmail.com","threadId":"33410","inReplyTo":"51659B5B.6000707@gmail.com","subject":"Re: git instaweb - share all project files","fromName":"Trenton D. Adams","fromEmail":"trenton.d.adams@gmail.com","sentAt":"2013-04-10T22:42:20Z","receivedAt":"2013-04-10T22:42:20Z","isPatch":false,"sender":{"key":"trenton.d.adams@gmail.com","avatar":null},"body":"#1 would actually work.  Though long term it would be cool to view it\nwith all the most recent commit information, kind of like github does.\n You know, showing \"updated 4 days ago\".\n\nOn Wed, Apr 10, 2013 at 11:03 AM, Jakub Narębski <jnareb@gmail.com> wrote:\n> W dniu 07.04.2013 05:02, Trenton D. Adams pisze:\n>\n>> On that first page that shows up, it shows the .git folder.  It would\n>> be kind of nice if it shared out both the git repo and the actual\n>> current project files.  I frequently have stuff I'd like to see in a\n>> web browser, and even requires one (i.e. Navigating to\n>> file:///home/blah/blah doesn't work; ajax requests for example)\n>\n> There are a few possible solutions, from simplest to most complicated:\n>\n> 1. Configure gitweb ran by git-instaweb to have 'worktree' link in\n>    the action bar pointing to 'file:///path/to/repo' (or rather\n>    'file:///path/to/workdir') via 'actions' feature, adding e.g.\n>\n>      $feature{'actions'}{'default'} =\n>         [('worktree', 'file:///path/to/repo', 'summary')];\n>\n>    to gitweb_config.perl / gitweb.conf used by git-instaweb's gitweb.\n>\n>    This of course works only for local use, so either git-instaweb\n>    or gitweb (in config) should check that we use it locally\n>    (e.g. if hostname is 'localhost' or equivalent).\n>\n> 2. In the web server configuration generated by git-instaweb, perhaps\n>    as an option, add serving of worktree (with mod_autoindex aka.\n>    'Options +Indexes' for Apache2, and equivalent solutions for *all*\n>    other supported web servers: lighttpd, mongoose, plack, webrick).\n>\n>    This may require some fiddling with URI rewriting, or change of\n>    gitweb URI, to be able to have both worktree index and gitweb\n>    script (gitweb is now under '/'), so it should probably be protected\n>    by an option to git-instaweb.\n>\n> 3. Add proper support to gitweb: add 'worktree' action (similar to\n>    'tree' action / view).  Probably needs to be made somewhat\n>    configurable (and of course enabled in git-instaweb).\n>\n>\n> Unfortunately solution 1.) which is simplest is not enough for your\n> situation...\n>\n> I can add 3.) to my gitweb TODO, but I don't know when I would be able\n> to get to implementing it.\n> --\n> Jakub Narębski\n>\n"},{"id":"214137","messageId":"51697812.6020106@gmail.com","threadId":"33410","inReplyTo":"CAMg8Y2qm9FuuMZh7jsAEyr=joUbsp=5V_zU5U86sW0Y=f2OVBA@mail.gmail.com","subject":"Re: git instaweb - share all project files","fromName":"Jakub Narębski","fromEmail":"jnareb@gmail.com","sentAt":"2013-04-13T15:21:54Z","receivedAt":"2013-04-13T15:21:54Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Please do not top-post.\n\nOn 11.04.2013, Trenton D. Adams wrote:\n\n> #1 would actually work.  Though long term it would be cool to view it\n> with all the most recent commit information, kind of like github does.\n>  You know, showing \"updated 4 days ago\".\n> \n> On Wed, Apr 10, 2013 at 11:03 AM, Jakub Narębski <jnareb@gmail.com> wrote:\n>> W dniu 07.04.2013 05:02, Trenton D. Adams pisze:\n>>\n>>> On that first page that shows up, it shows the .git folder.  It would\n>>> be kind of nice if it shared out both the git repo and the actual\n>>> current project files.  I frequently have stuff I'd like to see in a\n>>> web browser, and even requires one (i.e. Navigating to\n>>> file:///home/blah/blah doesn't work; ajax requests for example)\n>>\n>> There are a few possible solutions, from simplest to most complicated:\n>>\n>> 1. Configure gitweb ran by git-instaweb to have 'worktree' link in\n>>    the action bar pointing to 'file:///path/to/repo' (or rather\n>>    'file:///path/to/workdir') via 'actions' feature, adding e.g.\n>>\n>>      $feature{'actions'}{'default'} =\n>>         [('worktree', 'file:///path/to/repo', 'summary')];\n>>\n>>    to gitweb_config.perl / gitweb.conf used by git-instaweb's gitweb.\n>>\n>>    This of course works only for local use, so either git-instaweb\n>>    or gitweb (in config) should check that we use it locally\n>>    (e.g. if hostname is 'localhost' or equivalent).\n[...]\n\nUnfortunately it turns out such simple solution doesn't really work.\n\nFirst, for some reason Firefox 20.0 refuses to follow file:/// link,\neven though it shows correctly worktree if copy'n'pasted as URL in new\nwindow / new tab.\n\nSecond, it would work only for the top git repository.  There can be\nrepositories being submodules, or in untracked subdirectories (like\ne.g. 't/trash directory.tNNNN*/.git' in git/.git), and said 'worktree'\nlink would always lead to top git repository workdir.\n\nBut anyway, here you have it:\n-- >8 --\nSubject: [PATCH] git-instaweb: Show project files... kind of (WIP)\n\nOn first page that git-instaweb shows, it shows the .git folder.  It\nwould be kind of nice if it shared out both the git repo and the\nactual current project files (i.e. current worktree). [...]\n\n[...]\n\nThis commit implements solution 1.), with git-instaweb enabling it\nonly for local use, which means when it is run with `--local` option.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n git-instaweb.sh | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex 01a1b05..43ae255 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -22,6 +22,13 @@ restart        restart the web server\n . git-sh-setup\n \n fqgitdir=\"$GIT_DIR\"\n+if test x\"$(git rev-parse --is-bare-repository)\" = xfalse\n+then\n+\tfqworktree=\"$(git rev-parse --show-toplevel)\"\n+else\n+\tfqworktree=\"\"\n+fi\n+\n local=\"$(git config --bool --get instaweb.local)\"\n httpd=\"$(git config --get instaweb.httpd)\"\n root=\"$(git config --get instaweb.gitwebdir)\"\n@@ -588,6 +595,13 @@ our \\$projects_list = \\$projectroot;\n \n \\$feature{'remote_heads'}{'default'} = [1];\n EOF\n+\ttest x\"$fqworktree\" != x &&\n+\ttest x\"$local\" = xtrue &&\n+\tcat >>\"$fqgitdir/gitweb/gitweb_config.perl\" <<EOF\n+\\$feature{'actions'}{'default'} = [\n+\t('worktree', 'file://$fqworktree', 'summary')\n+];\n+EOF\n }\n \n configure_httpd() {\n-- \n1.8.2.1.367.geafc030.dirty\n"},{"id":"214140","messageId":"20130413200201.GA13323@dcvr.yhbt.net","threadId":"33410","inReplyTo":"51697812.6020106@gmail.com","subject":"Re: git instaweb - share all project files","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2013-04-13T20:02:01Z","receivedAt":"2013-04-13T20:02:01Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Jakub Narębski <jnareb@gmail.com> wrote:\n> Unfortunately it turns out such simple solution doesn't really work.\n> \n> First, for some reason Firefox 20.0 refuses to follow file:/// link,\n> even though it shows correctly worktree if copy'n'pasted as URL in new\n> window / new tab.\n\nI can confirm this behavior with chromium on Debian testing\n(25.0.1364.160 (Developer Build 186726) Debian 7.0)\n\nI can guess this is likely for security reasons.\n"},{"id":"214163","messageId":"516A8679.8090604@gmail.com","threadId":"33410","inReplyTo":"51659B5B.6000707@gmail.com","subject":"Re: git instaweb - share all project files","fromName":"Jakub Narębski","fromEmail":"jnareb@gmail.com","sentAt":"2013-04-14T10:35:37Z","receivedAt":"2013-04-14T10:35:37Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"W dniu 10.04.2013 19:03, Jakub Narębski pisze:\n> W dniu 07.04.2013 05:02, Trenton D. Adams pisze:\n> \n>> On that first page that shows up, it shows the .git folder.  It would\n>> be kind of nice if it shared out both the git repo and the actual\n>> current project files.  I frequently have stuff I'd like to see in a\n>> web browser, and even requires one (i.e. Navigating to\n>> file:///home/blah/blah doesn't work; ajax requests for example)\n> \n> There are a few possible solutions, from simplest to most complicated:\n[...]\n\n> 2. In the web server configuration generated by git-instaweb, perhaps\n>    as an option, add serving of worktree (with mod_autoindex aka.\n>    'Options +Indexes' for Apache2, and equivalent solutions for *all*\n>    other supported web servers: lighttpd, mongoose, plack, webrick).\n> \n>    This may require some fiddling with URI rewriting, or change of\n>    gitweb URI, to be able to have both worktree index and gitweb\n>    script (gitweb is now under '/'), so it should probably be protected\n>    by an option to git-instaweb.\n\nThe trouble (besides writing the same code for 5 web servers) is that\nyou have to make web server detect whether you want to access workdir or\ngitweb from URL alone...\n\n...and still you wouldn't have nice UI integration.\n\n> 3. Add proper support to gitweb: add 'worktree' action (similar to\n>    'tree' action / view).  Probably needs to be made somewhat\n>    configurable (and of course enabled in git-instaweb).\n\nI wonder if this should be solved via new actions, for example\n'worktree' and 'file' (which could also be a solution to problem in 2.)\nvia URI rewriting), or via new symbolic \"hash\" name, for example\n'WORKTREE' (like 'HEAD').\n\nHmmm... while at it, perhaps we can add browsing of INDEX version of files?\n\n-- \nJakub Narębski\n"}]}