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

Re: update-server-info logic

From
Shawn O. Pearce <spearce@spearce.org>
Date
Apr 28, 2009, 15:39 UTC
Message-ID
<20090428153911.GR23604@spearce.org>
In-Reply-To
<49F720BC.9080604@gmail.com>
Mike Gaffney <mr.gaffo@gmail.com> wrote:
>    I was wondering if someone could reply with a quick rundown of the  
> update-server-info logic. I'm looking at implementing it in JGit and  
> wanted to make sure I had it correct.
Its two things:
* rewrite $GIT_DIR/info/refs to be a complete catalog of all refs.
  IIRC this format is one ref per line, sorted by the full ref name,
  with the line format being "$SHA1\t$NAME\n".
  Most of this is already implemented in RefWriter.
  See writeInfoRefs().
* rewrite $GIT_DIR/objects/info/packs to be a complete catalog of the
  packs in $GIT_DIR/objects/pack.  The format is one pack per line,
  written as "P pack-$HASH.pack\n".  A final blank line is written
  on the end of the file, for I don't know why.  Its a good idea to
  sort the lines by the last modified date of the pack, descending,
  as clients will evaulate the file in order when searching for a
  missing object, and the usually need the more recent pack first.
  Most of this is already implemented in WalkRemoteObjectDatabase.
  See writeInfoPacks().
-- 
Shawn.
Previous: Mike Gaffney
Message 2 of 2 in “update-server-info logic”
  1. Mike GaffneyApr 28, 2009
  2. Shawn O. PearceApr 28, 2009

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.