Re: git ate my home directory :-(
- From
Richard Weinberger <richard@nod.at>
- Date
- Mar 25, 2013, 22:09 UTC
- Message-ID
- <5150CB34.1030008@nod.at>
- In-Reply-To
- <7vboa7w2vm.fsf@alter.siamese.dyndns.org>
Am 25.03.2013 23:06, schrieb Junio C Hamano:
Show 20 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> writes: > >> Richard Weinberger wrote: >> >>> In my scripts I'm setting GIT_DIR to use git-fetch and git-reset without changing the >>> current working directory all the time. >> >> Yeah, for historical reasons GIT_WORK_TREE defaults to $(pwd) when >> GIT_DIR is explicitly set. > > And it *WILL* be that way til the end of time. Unless you are at > the top level of your working tree, you are supposed to tell where > the top level is with GIT_WORK_TREE when you use GIT_DIR. Always. > > And that is the answer you should be giving here, not implicit > stuff, which is an implementation detail to help aliases. 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. >
Okay, I have to set GIT_DIR _and_ GIT_WORK_TREE to make my scripts safe again? I've always set only GIT_DIR because it just worked (till today...).
Thanks, //richard