Subject: Re: [PATCH GSoC 2/3] git-instaweb: Configure it to work with a global server root and projects list

From: Jakub Narebski <[email-masked]>
Date: Wed, 19 May 2010 01:05:57 +0200

On Tue, 18 May 2010, Pavan Kumar Sunkara wrote:
> Jakub Narebski wrote:
>> Pavan Kumar Sunkara wrote:

>>> and the httpd.conf along with server logs and pid go into
>>> '$(HOME)/.gitweb' directory.
>>>
>>> As there is no need to call git-instaweb in every git repository,
>>> configure gitweb to get $projects_list from file '$(HOME)/.gitweb/list'
>>> and $projectroot is ''
>>>
>>> Example of ~/.gitweb/list:
>>> home%2Fpavan%2Fgit%2F.git Linus+Torvalds
>>> home%2Fpavan%2Fgsoc%2F.git Pavan+Kumar+Sunkara
>>
>> This is quite a large change on how git-instaweb works.
>>
>> First, I think such change should be better left for a separate
>> commit, splitting this one in two: one making git-instaweb use
>> installed gitweb files, and installing gitweb files somewhere when
>> installing git, and second changing how git-instaweb behave.
>> "Do one thing, and do it well."  It would make easier to check
>> if there are errors in the commit.
> 
> Ok.
> 
>> Second, in my opinion it is not a good change at all.  Currently you
>> can run "git instaweb" when inside git repository, and get a web
>> browser (or a new tab in existing session of a running web browser)
>> with current repository in it, to browse its history.  It is similar
>> to running gitk (or other graphical history browser, like qgit, tig,
>> etc.), or running "git log", but with web interface.
> 
> Yes. But this change is vital for the success of my GSoC project. I
> will explain why.
> If you remember, my GSoC project contains some functionalities like
> creating/cloning repositories which need a server which need to start
> outside git directory.
> 
> Until now, I thought to use git-instaweb to do this. But I realised
> now that it would be better if we have another script.
> So we need to have a different "git-client" script which starts this client.
> 
> What do you say ?

Well, I can understand that.

There are two options how to resolve this issue without adding yet
another script (although on the other hand git-web-gui / git-client
could share code with git-instaweb just like git-difftool and 
git-mergetool do).

First is to leave git-instaweb similar to how it is now, with pid file,
server config file, gitweb config file, etc. in $GIT_DIR/gitweb, but
if it is invoked outside any git repository, start it in "repository
administration" mode, i.e. on the page that allows one to create new
repository or clone repository.

The alternate solution would be to follow the idea implemented in this
patch, namely per-user pid file, gitweb config file, server config file
etc. and the *list of projects* file in $HOME/.gitweb (or whenever
XDG / FHS / LSB says it should be named), _but_ add an easy way to add
a new project (a new repositoey) to list.  Perhaps even make 
'git instaweb', when run from inside git repository, add automatically
current repository to list (unless it is present there already), and
perhaps open 'summary' page for said repository.

But independently on which solution would be chosen, it should take place
in a separate commit,
> 
>> Now, current git-instaweb behavior has its quirks, but having
>> git-instaweb show _current_ repository is a very important feature,
>> and I'd rather we didn't lose it in transition.
>>
>> So in my opinion it would be better to just update git-instaweb and
>> generating git-instaweb to make use of installed gitweb and installed
>> gitweb files, but do not change organization of generated files; just
>> instead of gitweb.cgi there should be gitweb_config.perl with
>> appropriate configuration to show current repository.  And of course
>> there would be no gitweb files in $GIT_DIR/gitweb (in .git/gitweb)
>> directory.
> 
> Ok. Sure I will do it.

Thanks in advance.
-- 
Jakub Narebski
Poland