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

Re: The most efficient way to test if repositories share the same objects

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 22, 2018, 19:35 UTC
Message-ID
<xmqqlgejlx8e.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<87o9jfyl0y.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> But of course that'll just give you the tips. You could then use `git
> cat-file --batch-check` on both ends to see what commits from the other
> they report knowing about, in case they have branches that are
> ahead/behind the other.

I am not sure how you are envisioning to use "cat-file --batch-check" here. Do you mean to take "rev-list --all" output from both and compare, or something?

I am not sure how Konstantin defines "the most efficient", but if it is "with the smallest number of bits exchanged between the repositories", then the answer would probably be to find the root commit(s) in each repository and if they share any common root(s). If there isn't then there is no hope to share objects between them, of course.

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 3 of 8 in “The most efficient way to test if repositories share the same objects”
  1. Konstantin RyabitsevMar 22, 2018
  2. Ævar Arnfjörð BjarmasonMar 22, 2018
  3. Junio C HamanoMar 22, 2018
  4. Ævar Arnfjörð BjarmasonMar 22, 2018
  5. Konstantin RyabitsevMar 22, 2018
  6. Junio C HamanoMar 22, 2018
  7. Konstantin RyabitsevMar 23, 2018
  8. Ævar Arnfjörð BjarmasonMar 23, 2018

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.