Subject: Re: [PATCH v4 05/25] midx: clear auxiliary .rev after replacing the MIDX

From: Taylor Blau <[email-masked]>
Date: Tue, 31 Aug 2021 14:48:59 -0400

On Tue, Aug 31, 2021 at 10:44:38AM -0700, Junio C Hamano wrote:
> Taylor Blau <[email-masked]> writes:
>
> > After (the rerolled version of) this series, we'll be in a state where:
> >
> >   - `git multi-pack-index` will not run when outside of a Git
> >     repository.
> >   - The `--object-dir` argument will only recognize object directories
> >     belonging to an alternate of the current repository.
> >   - Using `--object-dir` to point to a repository which uses a
> >     different hash than the repository in the current working directory
> >     will continue to not work (as was the case before this series).
>
> Hmph, re-reading the document for midx:
>
>     --object-dir=<dir>::
>             Use given directory for the location of Git objects. We check
>             `<dir>/packs/multi-pack-index` for the current MIDX file, and
>             `<dir>/packs` for the pack-files to index.
>
> why does it matter if we are in a repository in the first place?
> It's not like we combine the objects from the specified object dir
> and our local object store (if that were the case, these two object
> stores must be compatible).

It shouldn't matter, but the use-case is described in [1] by Stolee.  He
explains it in detail, but I do think we have to live with
`--object-dir` in one way or another. He does say it'd be OK to only
be able to invoke it from within a repository, and to only be able to
reference alternates, though.

Thanks,
Taylor

[1]: https://lore.kernel.org/git/[email-masked]/