git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-instaweb: Add option to reuse previous config file

From
Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Date
Jun 1, 2010, 20:51 UTC
Message-ID
<AANLkTikn4m7O3d8jcfBqSE8-k1G0jg7kMH2c3zMo7yqD@mail.gmail.com>
In-Reply-To
<AANLkTinmDi-4nZm9x81FlDbp9mJMLoWmom2qUKnSLIrZ@mail.gmail.com>
2010/6/2 Jakub Narebski <jnareb@gmail.com>
Show 12 quoted lines
>
> On Tue, 1 June 2010, Pavan Kumar Sunkara wrote:
>
> > Add an option to git-instaweb which allows the usage of the old
> > gitweb_config.perl situated in '.git/gitweb' dir. When the option
> > is in use, gitweb_conf() won't be used and thus the gitweb_config.perl
> > won't be overwritten.
>
> I think that the correct solution would be to avoid overwriting
> (customized) git-instaweb's gitweb_config.perl, but to generate it if
> it does not exist.
>

So, you say that there is no use of this option ? Well, what happens if someone want's to overwrite their gitweb_config.perl ?

Show 9 quoted lines
>
> In addition to code change (see below), this would mean that the last
> sentence of the above paragraph of the commit message would read:
>
>  When the option is in use, gitweb_config.perl generated by
>  git-instaweb won't be overwritten.
>
> Or something like that.
>
Ok.
Show 18 quoted lines
>
> >
> > Usage:
> >       git instaweb --reuse-config
> >
> > Example:
> >       When I use git-instaweb, it is hard to add the line (Use of
> > highlighting support) $feature{'highlight'}{'default'] = [1]; to the
> > gitweb_config.perl file everytime I initiate the server. With this,
> > it's enough to use this option.
>
> Hmmm, perhaps gitweb_config.perl file used by git-instaweb should
> enable all features... but some features (like mentioned above
> 'highlight' feature) depends on external tools to be installed (like
> 'highlight' being in $PATH for 'highlight' feature).
>
> So this wouldn't solve your problem, I don't think.
>

Yeah. That is why I came up with this. I am tired of adding extra lines in the file everytime I start the server.

Show 8 quoted lines
>
> >
> > Also update Documentation of git-instaweb
>
> Actually this sentene is not strictly necessary: when adding new
> option you should update manpage respectively.  It is not something
> that is worth mentioning, IMVHO.
>
I don't know that. Sorry.
Show 31 quoted lines
>
> >
> > Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
> > ---
>
> > @@ -49,6 +49,9 @@ OPTIONS
> >       linkgit:git-web--browse[1] for more information about this. If
> >       the script fails, the URL will be printed to stdout.
> >
> > +--reuse-config::
> > +     The previous gitweb_config.perl will not be overwritten.
> > +
>
> This can imply that if file does not exist, it would be generated.
>
> > diff --git a/git-instaweb.sh b/git-instaweb.sh
> > index 1af4d5a..7b8b8d1 100755
> > --- a/git-instaweb.sh
> > +++ b/git-instaweb.sh
> > @@ -13,6 +13,7 @@ p,port=        the port to bind to
> >  d,httpd=       the command to launch
> >  b,browser=     the browser to launch
> >  m,module-path= the module path (only needed for apache2)
> > +reuse-config To use the previous gitweb_config.perl file from GIT_DIR. It will not be overwritten.
>
> First, misaligned (using TAB instead of SP, like the rest of
> entries).  Second, too long.
>
>  m,module-path= the module path (only needed for apache2)
>  +reuse-config  reuse previous gitweb_config.perl from GIT_DIR
>
Ok.
Show 34 quoted lines
>
> >   Action
> >  stop           stop the web server
> >  start          start the web server
> > @@ -27,6 +28,7 @@ httpd="$(git config --get instaweb.httpd)"
> >  root="$(git config --get instaweb.gitwebdir)"
> >  port=$(git config --get instaweb.port)
> >  module_path="$(git config --get instaweb.modulepath)"
> > +no_reuse=true
> >
> >  conf="$GIT_DIR/gitweb/httpd.conf"
> >
> > @@ -171,6 +173,10 @@ do
> >               shift
> >               module_path="$1"
> >               ;;
> > +     --reuse-config)
> > +             shift
> > +             no_reuse=false
> > +             ;;
> >       --)
> >               ;;
> >       *)
> > @@ -551,7 +557,7 @@ our \$projects_list = \$projectroot;
> >  EOF
> >  }
> >
> > -gitweb_conf
> > +test "$no_reuse" = true && gitweb_conf
>
> You would need to test somewhere if gitweb_config.perl file exists,
> and if it does not exist generate it anyway, independent on
> `--reuse-config` variable.
>

Ok. Please answer the above question, so that I can prepare another version. Thanks, Pavan.

Previous: Jakub NarebskiNext: Jakub Narebski
Message 3 of 5 in “git-instaweb: Add option to reuse previous config file”
  1. git-instaweb: Add option to reuse previous config filePavan Kumar Sunkara, Jun 1, 2010
  2. Jakub NarebskiJun 1, 2010
  3. Pavan Kumar SunkaraJun 1, 2010
  4. Jakub NarebskiJun 1, 2010
  5. Petr BaudisJun 2, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.