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

Re: [RFC] log(n)-transmissions common commit handshake

From
Thomas Rast <trast@student.ethz.ch>
Date
Sep 18, 2008, 08:18 UTC
Message-ID
<200809181018.52811.trast@student.ethz.ch>
In-Reply-To
<200809180100.32626.trast@student.ethz.ch>
I wrote:
Show 10 quoted lines
> * Impact/clever use of refs
> 
>   For some reason, current git sends all refs to the server, even if
>   the server should already know about lots of them.  For example, in
>   git.git, emitting v1.6.0.2 covers almost all tags in the repository
>   by simple ancestor scanning.
> 
>   Is there a reason for this behaviour?  Otherwise it would be better
>   to emit them in date order and intelligently handle commons.  (In
>   fact this does not depend on the discussed change.)

As an addendum, I think the following would be a good way to cleverly use refs to reduce work:

Cache a "reduced" DAG which just maps the ref'd commit relationships, i.e., shows the reachability of refs only. This needs to be written out to disk between invocations.

At the start of the protocol, the server announces all its refs. We can use the reduced DAG to infer the minimal set of ref heads we need to announce to have the server know all common ones. We can also mark all the other refs as "common but not announced yet", so that the backwards marking and searching routines know to stop there.

This should reduce the number of refs listed back to the server to only a handful, and at the same time, stop the client from searching backwards through _all_ history (which can take a bit of time, and is one of the weaknesses of my proposal) in most cases.

- Thomas
-- 
Thomas Rast
trast@student.ethz.ch
Previous: Thomas Rast
Message 13 of 13 in “[RFC] log(n)-transmissions common commit handshake”
  1. Thomas RastSep 17, 2008
  2. fetch-pack: log(n)-transmission find_common()Thomas Rast, Sep 17, 2008
  3. fetch-pack: log(n)-transmission find_common()Thomas Rast, Sep 24, 2008
  4. fetch-pack: log(n)-transmission find_common()Thomas Rast, Oct 23, 2008
  5. Nicolas PitreOct 24, 2008
  6. Nanako ShiraishiOct 27, 2008
  7. Junio C HamanoOct 28, 2008
  8. Nicolas PitreOct 28, 2008
  9. Thomas RastOct 28, 2008
  10. 0/2 fetch-pack: log(n)-transmission find_common()Thomas Rast, Dec 6, 2008
  11. 1/2 fetch-pack: rearrange main loopThomas Rast, Dec 6, 2008
  12. 2/2 fetch-pack: log(n)-transmission find_common()Thomas Rast, Dec 6, 2008
  13. Thomas RastSep 18, 2008

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.