From: Nguyen Thai Ngoc Duy Date: Thu, 13 Oct 2011 04:54:29 GMT Subject: Re: [PATCH 3/3] t5403: do not use access repos with GIT_DIR when worktree is involved Message-ID: In-Reply-To: <7vwrc95xe5.fsf@alter.siamese.dyndns.org> 2011/10/13 Junio C Hamano : > Nguyễn Thái Ngọc Duy writes: > >> Setting GIT_DIR alone means worktree is current directory for legacy >> reasons. Avoid using that, instead go to the worktree and execute >> commands there. >> >> The troublesome command is "GIT_DIR=clone2/.git git add clone2/b". The >> real worktree is clone2, but that command tells git worktree is $(pwd). >> What does user expect to add then? Should the new entry in index be "b" >> or "clone2/b"? > > There is no troublesomeness here, as the semantics has been clearly > defined and (hopefully) stayed constant before the days when GIT_WORK_TREE > was invented. It's not wrong per se. The trouble comes from the people who reads the test. It's not clear the author wants to add "b" or "clone2/b". Another thing, because "clone2" has .git inside, should "clone2" in this case be considered a submodule and "git add" refuse to add anything "clone2/*" but "clone2" itself? > Unless we are trying to break them without knowing, and declare that we > deprecated it after the fact, which is not exactly the way we want to > remove existing (mis)feature. I had problems with my read_directory() rewrite but it's been some time since I touched the code. I don't remember what went wrong. Need to have another look. -- Duy