Re: [PATCH 2/6] sha1_file: always allow relative paths to alternates
- From
Jeff King <peff@peff.net>
- Date
- Oct 2, 2016, 13:03 UTC
- Message-ID
- <20161002130346.4ay2d52su3bggh6o@sigill.intra.peff.net>
- In-Reply-To
- <c27dc1a4-3c7a-2866-d9d8-f5d3eb161650@web.de>
On Sun, Oct 02, 2016 at 11:07:39AM +0200, René Scharfe wrote:
Show 23 quoted lines
> Am 30.09.2016 um 21:36 schrieb Jeff King: > > We adjust the test script here to demonstrate that this now > > works. Unfortunately, we can't demonstrate that the > > duplicate is suppressed, since it has no user-visible > > behavior (it's just one less place for our object lookups to > > go). But you can verify it manually via gdb, with something > > like: > > > > for i in a b c; do > > git init --bare $i > > blob=$(echo $i | git -C $i hash-object -w --stdin) > > done > > echo "../../b/objects" >a/objects/info/alternates > > echo "../../c/objects" >>a/objects/info/alternates > > echo "../../c/objects" >b/objects/info/alternates > > gdb --args git cat-file -e $blob > > > > After prepare_alt_odb() runs, we have only a single copy of > > "/path/to/c/objects/" in the alt_odb list. > > A better way would be to provide a UI for that. We could easily bolt > it to the side of count-objects like in the patch below. Feels a bit > hackish, though.
Yeah, I thought about something like that, but I'm a bit hesitant to add public interfaces that exist just for testing. OTOH, "count-objects --list-alternates" is conceivably a useful debugging tool for "did I set up my alternates correctly?".
-Peff