@matheusbsbs / matheus-bagliano / commits / f5e025a9d5
Fork 0

Documentation: always respect core.worktree if set

The value of core.worktree in a ".git/config" is honored even when it differs from the directory that has the ".git" directory as its subdirectory. This is likely to be a misconfiguration, so warn users about it. Also, drop the part of the documentation that incorrectly claimed that we ignore such a misconfigured value. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Dec 29, 2009 at 14:48 UTC f5e025a9d5b35e24768475f6890b836ce0d5ed15
1 file changed +15 -8
Documentation/config.txt
+15 -8
@@ -297,17 +297,24 @@ false), while all other repositories are assumed to be bare (bare
297 = true).
298
299 core.worktree::
300 - Set the path to the working tree. The value will not be
301 - used in combination with repositories found automatically in
302 - a .git directory (i.e. $GIT_DIR is not set).
300 + Set the path to the root of the work tree.
301 This can be overridden by the GIT_WORK_TREE environment
302 variable and the '--work-tree' command line option. It can be
305 - a absolute path or relative path to the directory specified by
306 - --git-dir or GIT_DIR.
307 - Note: If --git-dir or GIT_DIR are specified but none of
303 + an absolute path or a relative path to the .git directory,
304 + either specified by --git-dir or GIT_DIR, or automatically
305 + discovered.
306 + If --git-dir or GIT_DIR are specified but none of
307 --work-tree, GIT_WORK_TREE and core.worktree is specified,
309 - the current working directory is regarded as the top directory
310 - of your working tree.
308 + the current working directory is regarded as the root of the
309 + work tree.
310 ++
311 +Note that this variable is honored even when set in a configuration
312 +file in a ".git" subdirectory of a directory, and its value differs
313 +from the latter directory (e.g. "/path/to/.git/config" has
314 +core.worktree set to "/different/path"), which is most likely a
315 +misconfiguration. Running git commands in "/path/to" directory will
316 +still use "/different/path" as the root of the work tree and can cause
317 +great confusion to the users.
318
319 core.logAllRefUpdates::
320 Enable the reflog. Updates to a ref <ref> is logged to the file