Re: [PATCH v5 1/4] git: make super-prefix option
- From
Jeff King <peff@peff.net>
- Date
- Sep 29, 2016, 18:39 UTC
- Message-ID
- <20160929183940.vgac7by74gmglaf2@sigill.intra.peff.net>
- In-Reply-To
- <1475099443-145608-2-git-send-email-bmwill@google.com>
On Wed, Sep 28, 2016 at 02:50:40PM -0700, Brandon Williams wrote:
Show 6 quoted lines
> Add a super-prefix environment variable 'GIT_INTERNAL_SUPER_PREFIX' > which can be used to specify a path from above a repository down to its > root. The immediate use of this option is by commands which have a > --recurse-submodule option in order to give context to submodules about > how they were invoked. This option is currently only allowed for > builtins which support a super-prefix.
What about non-builtins?
E.g., what should
git --super-prefix=foo bar
do? Should the externals and scripts check the presence of GIT_INTERNAL_SUPER_PREFIX and barf if it is set? Most scripts would probably notice eventually when calling some other builtin that doesn't support SUPER_PREFIX, but it seems hacky to count on that.
There's also the question of 3rd-party programs. If we want to be conservative, I think you'd want to just always bail in execv_dashed_external() if --super-prefix is in use. That doesn't give an option for scripts to say "hey, I support this", but we can perhaps worry about loosening later.
-Peff