author | Jonathan Nieder <jrnieder@gmail.com> | |
Wed, 19 Jan 2011 12:42:30 +0000 (06:42 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 21 Jan 2011 22:31:24 +0000 (14:31 -0800) | ||
commit | 4868b2ea17b7a5e8171cb109423a25a269bfefe5 | |
tree | c5d2d33f63bdd432d8424869642d93401e74786c | tree | snapshot |
parent | 786dabecd4766bfda0083491ef543e3b5d1d9f39 | commit | diff |
Subject: setup: officially support --work-tree without --git-dir
The original intention of --work-tree was to allow people to work in a
subdirectory of their working tree that does not have an embedded .git
directory. Because their working tree, which their $cwd was in, did not
have an embedded .git, they needed to use $GIT_DIR to specify where it is,
and because this meant there was no way to discover where the root level
of the working tree was, so we needed to add $GIT_WORK_TREE to tell git
where it was.
However, this facility has long been (mis)used by people's scripts to
start git from a working tree _with_ an embedded .git directory, let git
find .git directory, and then pretend as if an unrelated directory were
the associated working tree of the .git directory found by the discovery
process. It happens to work in simple cases, and is not worth causing
"regression" to these scripts.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The original intention of --work-tree was to allow people to work in a
subdirectory of their working tree that does not have an embedded .git
directory. Because their working tree, which their $cwd was in, did not
have an embedded .git, they needed to use $GIT_DIR to specify where it is,
and because this meant there was no way to discover where the root level
of the working tree was, so we needed to add $GIT_WORK_TREE to tell git
where it was.
However, this facility has long been (mis)used by people's scripts to
start git from a working tree _with_ an embedded .git directory, let git
find .git directory, and then pretend as if an unrelated directory were
the associated working tree of the .git directory found by the discovery
process. It happens to work in simple cases, and is not worth causing
"regression" to these scripts.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
setup.c | diff | blob | history | |
t/t1510-repo-setup.sh | diff | blob | history |