Re: git ate my home directory :-(
- From
Brandon Casey <drafnel@gmail.com>
- Date
- Mar 25, 2013, 22:21 UTC
- Message-ID
- <CA+sFfMexDR50b5FnJ-4MS8pxPXmg0CCbzCLVc3vx5XjfqdY1nQ@mail.gmail.com>
- In-Reply-To
- <20130325221355.GH1414@google.com>
On Mon, Mar 25, 2013 at 3:13 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 32 quoted lines
> Junio C Hamano wrote: > >> I do not >> know how things will break when the end user sets and exports it to >> the environment, and I do not think we would want to make any >> promise on how it works. > > That's a reasonable desire, and it means it's a good thing we noticed > this before the envvar escaped to "master". People *will* use such > exposed interfaces unless they are clearly marked as internal. That's > just a fact of life. > > Here's a rough patch to hopefully improve matters. > > Longer term, it would be nice to have something like > GIT_IMPLICIT_WORK_TREE exposed to let scripts cache the result of the > search for .git. Maybe something like "GIT_BARE=(arbitrary value)" > would be a good interface. > > Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> > --- > > diff --git a/cache.h b/cache.h > index 59e5b53..8f92b6d 100644 > --- a/cache.h > +++ b/cache.h > @@ -377,7 +377,7 @@ static inline enum object_type object_type(unsigned int mode) > * of this, but we use it internally to communicate to sub-processes that we > * are in a bare repo. If not set, defaults to true. > */ > -#define GIT_IMPLICIT_WORK_TREE_ENVIRONMENT "GIT_IMPLICIT_WORK_TREE" > +#define GIT_IMPLICIT_WORK_TREE_ENVIRONMENT "GIT_INTERNAL_IMPLICIT_WORK_TREE"
Maybe the environment variable for internal-use-only should be prefixed with an underscore?
-Brandon