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
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 22, 2018, 19:20 UTC
Message-ID
<87o9jfyl0y.fsf@evledraar.gmail.com>
In-Reply-To
<14d0937f-0e39-7af7-a395-3046ec5d5c16@linuxfoundation.org>
On Thu, Mar 22 2018, Konstantin Ryabitsev wrote:
Show 5 quoted lines
> What is the most efficient way to test if repoA and repoB share common
> commits? My goal is to automatically figure out if repoB can benefit
> from setting alternates to repoA and repacking. I currently do it by
> comparing the output of "show-ref --tags -s", but that does not work for
> repos without tags.

If you're using show-ref already to get the tag tips, you can use for-each-ref to get all tips.

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.

Previous: Konstantin RyabitsevNext: Junio C Hamano
Message 2 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.