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

Re: .git/info/refs

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 25, 2007, 08:14 UTC
Message-ID
<Pine.LNX.4.63.0701250900380.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<2197.69.104.58.50.1169671494.squirrel@www.zytor.com>
Hi,
On Wed, 24 Jan 2007, hpa@zytor.com wrote:
Show 21 quoted lines
> > H. Peter Anvin wrote:
> >
> >>> Besides, we can't rely that .git/info/refs is up to date, or even
> >>> exists.
> >>> It is for dumb protocols, not for gitweb.
> >>
> >> Well, SOMETHING needs to be done for this page, since it can take 15
> >> minutes or more to generate.  Caching doesn't help one iota, since it's
> >> stale before being generated.
> >
> > The simple and fast solution would be to make post-update hook contain
> > the git-for-each-ref with parameters like in git_get_last_activity,
> > saving e.g. to .git/info/last-committer, and in gitweb read this file
> > if it exist, run git-for-each-ref otherwise (similar to what we used to
> > do with .git/info/refs and git-peek-remote in gitweb).
> >
> 
> Right, this is basically what I'm saying; the question is only whether or
> not this fits into .git/info/refs or should be a separate file.
> 
> Either way, I think git-update-server-info should generate all these files.

Well, no. At least not per default. What you want is _very_ special to gitweb. It is _only_ needed by gitweb. And .git/info/refs is for _dumb transports_, _not_ for gitweb.

That said, I think it makes sense _in your setup_ to trigger updating _another_ file for use in gitweb.

Remember, this is all very, very special for gitweb. So let's separate it cleanly from all which is not special for gitweb.

I hope I have made it clear why (at least IMHO) it would be wrong, wrong, wrong to change the format of .git/info/refs _only_ for gitweb, which it is not meant for to begin with.

So let's introduce another file in .git/info/ especially dedicated to gitweb.

Then we are free to introduce real cool performance hacks, like using Storable to store the parsed data structures (I was alluding to this in an earlier reply, as "serializing"). Then you just retrieve the file -- if it exists -- or call for-each-ref (like Jakub said).

By separating this gitweb-special thing cleanly, maybe into a hook, we can have a perl script which writes this file. We can write a simple hash, which may or may not contain keys, thus being of "extensible format".

By having this perl script, you can -- as root -- run it as the appropriate user for each repository where it does not exist yet.

Remains the problem: how do we _force_ this hook enabled site-wide, i.e. in _all_ repos?

But that is too easy: just edit the existing template, and then replace the update hooks in all repos (possibly verifying that the existing update hook indeed matches the old template).

So what problems remain with this approach?

Ciao, Dscho

Previous: hpa@zytor.comNext: H. Peter Anvin
Message 23 of 39 in “.git/info/refs”
  1. H. Peter AnvinJan 24, 2007
  2. Jakub NarebskiJan 24, 2007
  3. H. Peter AnvinJan 24, 2007
  4. Johannes SchindelinJan 24, 2007
  5. H. Peter AnvinJan 24, 2007
  6. Johannes SchindelinJan 24, 2007
  7. H. Peter AnvinJan 24, 2007
  8. Johannes SchindelinJan 24, 2007
  9. H. Peter AnvinJan 24, 2007
  10. Jakub NarebskiJan 24, 2007
  11. Jakub NarebskiJan 24, 2007
  12. Johannes SchindelinJan 24, 2007
  13. H. Peter AnvinJan 25, 2007
  14. Jakub NarebskiJan 26, 2007
  15. Junio C HamanoJan 26, 2007
  16. H. Peter AnvinJan 26, 2007
  17. Jakub NarebskiJan 26, 2007
  18. Johannes SchindelinJan 26, 2007
  19. H. Peter AnvinJan 26, 2007
  20. H. Peter AnvinJan 26, 2007
  21. Jakub NarebskiJan 24, 2007
  22. hpa@zytor.comJan 24, 2007
  23. Johannes SchindelinJan 25, 2007
  24. H. Peter AnvinJan 25, 2007
  25. Johannes SchindelinJan 25, 2007
  26. hpa@zytor.comJan 24, 2007
  27. Junio C HamanoJan 25, 2007
  28. H. Peter AnvinJan 25, 2007
  29. Junio C HamanoJan 25, 2007
  30. H. Peter AnvinJan 25, 2007
  31. Johannes SchindelinJan 25, 2007
  32. H. Peter AnvinJan 27, 2007
  33. Santi BéjarJan 31, 2007
  34. Johannes SchindelinFeb 1, 2007
  35. H. Peter AnvinFeb 1, 2007
  36. Johannes SchindelinFeb 1, 2007
  37. H. Peter AnvinFeb 1, 2007
  38. Matthias LederhoferFeb 1, 2007
  39. H. Peter AnvinFeb 1, 2007

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.