Re: [PATCH] Documentation: always respect core.worktree if set
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 28, 2009, 09:16 UTC
- Message-ID
- <7viqbrv4pa.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1261979704-30074-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> In the beginning, there was GIT_DIR environment variable, with a very > simple semantics: > ...
(Omitted an explanation of how GIT_DIR and core.worktree work together).
Show 11 quoted lines
> According to the current documentation, if GIT_DIR is not set, > core.worktree is not respected, and the parent directory of the "git > directory" may be used as worktree. This case, unless core.worktree > matches the parent directory of the "git directory" in question, seems > a misconfiguration and nothing else. So remove this part of the > documentation. > > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> > --- > Junio may find the description highly familiar :) only slightly modified > at the end
I found it familiar, but I didn't see how that earlier part leads to the conclusion in, or even gives a necessary background information for, the last paragraph. Perhaps you omitted something in the middle that was more relevant? If so, I would suggest omiting the earlier part, whose purpose was to prepare readers for that middle part, as well.
And I don't think the claim your last paragraph makes is consistent with what the patch does at all.
Removing the "it will be ignored" from the documentation is a good change only in the sense that it makes the document closer to reality, but "it is a misconfiguration" is not a good justification of the change.
A documentation-only patch that can be justitifed by "a misconfiguration" claim would probably read like this:
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.
---
core.worktree::
Set the path to the root of the work tree. Note that this
is honored even when set in a configuration file in a
".git" subdirectory of a directory, and its value differs
from the latter directory (e.g. "/path/to/.git/config" has
core.worktree set to "/different/path"), which is most
likely a misconfiguration. Running git commands in
"/path/to" directory will still use "/different/path" as
the root of the work tree and can cause great confusion to
the users.Your earlier patch took a different approach to the misconfiguration. "It is an error, so we silently _ignore_". It is a valid thing to say, but the "silently" part is not friendly to the user and we would probably want to diagnose and warn. That is what I originally meant.