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

Re: Questions about git-push for huge repositories

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 6, 2015, 17:48 UTC
Message-ID
<xmqq4mj7bfsf.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAN6cQGPcGpaXUGu_7aaeJtMbruMocte-5po97vG5r39f=YdTZQ@mail.gmail.com>
Levin Du <zslevin@gmail.com> writes:
> Since A & B share many common files, to save disk space, I'd like to merge them:
> (note: branch of A & B are independent, i.e. have no common ancestor.)

Not having any shared history is exactly the cause. If the optimization were to exchange list of all the commits, blobs and trees each side has and sending only the ones that the receiving end lacks, you would get the result you seem to be expecting, but that approach is not taken because it is impractically expensive.

Instead, the object transfer is optimized by comparing what commits each side has and sending trees and blobs that are reachable from the commits that the receiving side does not have. This approach does not have to exchange the list of trees and blobs at all, and in a pair of repositories for the same project, it does not even have to send the list of all commits, because traversing from the tips of histories and exchanging more recent ones iteratively is expected to find commits common to both and because of the history graph is a DAG, we know what is behind commits that are common exist on both ends.

Previous: Levin DuNext: Levin Du
Message 2 of 9 in “Questions about git-push for huge repositories”
  1. Levin DuSep 6, 2015
  2. Junio C HamanoSep 6, 2015
  3. Levin DuSep 7, 2015
  4. Levin DuSep 7, 2015
  5. Levin DuSep 8, 2015
  6. Jeff KingSep 8, 2015
  7. Junio C HamanoSep 8, 2015
  8. Jeff KingSep 8, 2015
  9. Jeff KingSep 8, 2015

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.