From: Junio C Hamano Date: Fri, 18 Oct 2013 22:43:52 GMT Subject: Re: [git-users] Problem using detached worktrees with commands implemented in scripts Message-ID: In-Reply-To: <201310182225.r9IMP4i3002659@freeze.ariadne.com> worley@alum.mit.edu (Dale R. Worley) writes: >> From: Junio C Hamano > >> Side note: without GIT_WORK_TREE environment (or >> core.worktree), there is no way to tell where the top level >> is, so you were limited to always be at the top level of >> your working tree if you used GIT_DIR to refer to a >> repository that is not embedded in your working tree. There >> were some changes in this area, but I do not recall the >> details offhand. > > That's not true. The core.worktree config variable tells the top of > the worktree, so once you've located the repository, you know where > the worktree is. Read the second line again, perhaps? > ... it's not clear why GIT_WORK_TREE exists, ... The configuration item came _way_ later than the environment, and we need to keep users and scripts from old world working, that is why.