2011/10/13 Junio C Hamano <gitster@xxxxxxxxx>: > Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> 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 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html