Re: git ate my home directory :-(

2013-03-27 Thread Duy Nguyen
On Tue, Mar 26, 2013 at 10:04 PM, Jeff King p...@peff.net wrote: specifies a path to use instead of the default `.git` for the base of the repository. The '--git-dir' command-line option also sets this value. + If neither GIT_WORK_TREE nor '--work-tree' is set, the +

Re: git ate my home directory :-(

2013-03-26 Thread Philip Oakley
From: Junio C Hamano gits...@pobox.com Sent: Monday, March 25, 2013 10:06 PM Jonathan Nieder jrnie...@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

Re: git ate my home directory :-(

2013-03-26 Thread Duy Nguyen
On Tue, Mar 26, 2013 at 08:02:30AM -, Philip Oakley wrote: 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

Re: git ate my home directory :-(

2013-03-26 Thread Richard Weinberger
Am 26.03.2013 09:02, schrieb Philip Oakley: From: Junio C Hamano gits...@pobox.com Sent: Monday, March 25, 2013 10:06 PM Jonathan Nieder jrnie...@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

Re: git ate my home directory :-(

2013-03-26 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Tue, Mar 26, 2013 at 04:48:44PM +0700, Nguyen Thai Ngoc Duy wrote: Something like this, maybe? -- 8 -- Subject: [PATCH] git.txt: document the implicit working tree setting with GIT_DIR Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com ---

Re: git ate my home directory :-(

2013-03-26 Thread Richard Weinberger
Am 26.03.2013 15:56, schrieb Jeff King: On Tue, Mar 26, 2013 at 02:07:44PM +0100, Richard Weinberger wrote: Should this important warning be part of the git(1) documentation on the environment variables (and possibly other places) given the consequences of this case? It wasn't something I'd

Re: git ate my home directory :-(

2013-03-26 Thread Junio C Hamano
Jeff King p...@peff.net writes: Yes, setting GIT_DIR but not GIT_WORK_TREE has always been a valid way to work on a repository where you do not want the working tree polluted with your .git file. It's not a common setup, but people do use it. E.g., you might keep ~/mail as a git repo, but do

Re: git ate my home directory :-(

2013-03-26 Thread Philip Oakley
From: Duy Nguyen pclo...@gmail.com Sent: Tuesday, March 26, 2013 9:48 AM On Tue, Mar 26, 2013 at 08:02:30AM -, Philip Oakley wrote: 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

git ate my home directory :-(

2013-03-25 Thread Richard Weinberger
Hi! Today I've discovered that on the build server my home directory was empty. A post-mortem analysis showed that the git-clean command I've added to my kernel build script is the evil doer. In my scripts I'm setting GIT_DIR to use git-fetch and git-reset without changing the current working

Re: git ate my home directory :-(

2013-03-25 Thread Jonathan Nieder
Hi, 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. In git versions including the patch

Re: git ate my home directory :-(

2013-03-25 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes: In git versions including the patch 2cd83d10bb6b (setup: suppress implicit . work-tree for bare repos, 2013-03-08, currently in next but not master), you can set GIT_IMPLICIT_WORK_TREE=0 to avoid this behavior. WAT? -- To unsubscribe from this list:

Re: git ate my home directory :-(

2013-03-25 Thread Junio C Hamano
Jonathan Nieder jrnie...@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.

Re: git ate my home directory :-(

2013-03-25 Thread Jonathan Nieder
Junio C Hamano wrote: Jonathan Nieder jrnie...@gmail.com writes: In git versions including the patch 2cd83d10bb6b (setup: suppress implicit . work-tree for bare repos, 2013-03-08, currently in next but not master), you can set GIT_IMPLICIT_WORK_TREE=0 to avoid this behavior. WAT? Is that

Re: git ate my home directory :-(

2013-03-25 Thread Richard Weinberger
Am 25.03.2013 23:06, schrieb Junio C Hamano: Jonathan Nieder jrnie...@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

Re: git ate my home directory :-(

2013-03-25 Thread Jonathan Nieder
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

Re: git ate my home directory :-(

2013-03-25 Thread Jonathan Nieder
Richard Weinberger wrote: 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...). chdir-ing into the git repo without setting any GIT_* vars is probably the simplest way to go. -- To unsubscribe from

Re: git ate my home directory :-(

2013-03-25 Thread Junio C Hamano
Richard Weinberger rich...@nod.at writes: 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...). That means you never run your script inside a subdirectory ;-) If your $GIT_DIR is tied to a single

Re: git ate my home directory :-(

2013-03-25 Thread Brandon Casey
On Mon, Mar 25, 2013 at 3:13 PM, Jonathan Nieder jrnie...@gmail.com wrote: 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

Re: git ate my home directory :-(

2013-03-25 Thread Richard Weinberger
Am 25.03.2013 23:20, schrieb Junio C Hamano: Richard Weinberger rich...@nod.at writes: 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...). That means you never run your script inside a