Re: [PATCH 1/2] ls-files: adding support for submodules
- From
Jeff King <peff@peff.net>
- Date
- Sep 23, 2016, 06:06 UTC
- Message-ID
- <20160923060643.3ubr5gn7qczzs2ut@sigill.intra.peff.net>
- In-Reply-To
- <CAGZ79kZ+LTd5PuT4+Z9K6d+GQ-33E=tLY1Fokbp22uNoygaEtg@mail.gmail.com>
On Thu, Sep 22, 2016 at 10:47:17PM -0700, Stefan Beller wrote:
Show 18 quoted lines
> On Thu, Sep 22, 2016 at 8:41 PM, Jeff King <peff@peff.net> wrote:
>
> >> * As Stefan alluded to (much) earlier, it might be a better idea
> >> to have these 'prefix' as the global option to "git" potty, not
> >> to each subcommand that happens to support them;
> >
> > That seems like it would be nice, but there's going to be an interim
> > period where some commands do not respect the global "--prefix" at all
> > (in the worst case, consider a third party command).
>
> My current line of thinking is to have a new flag in command struct in
> git.c to enable the global --prefix, (c.f. RUN_SETUP | NEED_WORK_TREE)
> so we'd have a ALLOW_OUTSIDE_PREFIX flag which can be used to enable
> this feature. In case that flag is not set, but a user tries a
> --prefix=<somewhere>
> we can still
>
> die("nope, we don't do that");Yeah, a positive "I support this" flag would at least let us correctly flag errors, which is the best we can do. That won't work for non-builtins, but perhaps it is good enough in practice.
-Peff