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

2018-03-23 Thread Ævar Arnfjörð Bjarmason
On Fri, Mar 23 2018, Konstantin Ryabitsev wrote: > On 03/22/18 17:44, Junio C Hamano wrote: >> Wouldn't it be more efficient to avoid doing so one-by-one? >> That is, wouldn't >> >> rev-list --max-parents=0 --all >> >> be a bit faster than >> >> for-each-ref | >> while read object

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

2018-03-23 Thread Konstantin Ryabitsev
On 03/22/18 17:44, Junio C Hamano wrote: > Wouldn't it be more efficient to avoid doing so one-by-one? > That is, wouldn't > > rev-list --max-parents=0 --all > > be a bit faster than > > for-each-ref | > while read object type refname > do > rev-list

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

2018-03-22 Thread Junio C Hamano
Konstantin Ryabitsev writes: > $ time git rev-list --max-parents=0 HEAD > a101ad945113be3d7f283a181810d76897f0a0d6 > cd26f1bd6bf3c73cc5afe848677b430ab342a909 > be0e5c097fc206b863ce9fe6b3cfd6974b0110f4 > 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 > > real0m6.311s

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

2018-03-22 Thread Konstantin Ryabitsev
On 03/22/18 15:35, Junio C Hamano wrote: > 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

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

2018-03-22 Thread Ævar Arnfjörð Bjarmason
On Thu, Mar 22 2018, Junio C. Hamano wrote: > Ævar Arnfjörð Bjarmason 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

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

2018-03-22 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason 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

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

2018-03-22 Thread Ævar Arnfjörð Bjarmason
On Thu, Mar 22 2018, Konstantin Ryabitsev wrote: > 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

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

2018-03-22 Thread Konstantin Ryabitsev
Hi, all: 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