git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 8 of 11 in “core.worktree bug”
  1. Robin RosenbergDec 7, 2009
  2. Nguyen Thai Ngoc DuyDec 15, 2009
  3. Fix core.worktree being used when GIT_DIR is not setNguyễn Thái Ngọc Duy, Dec 27, 2009
  4. Junio C HamanoDec 27, 2009
  5. Robin RosenbergDec 28, 2009
  6. Nguyen Thai Ngoc DuyDec 28, 2009
  7. Documentation: always respect core.worktree if setNguyễn Thái Ngọc Duy, Dec 28, 2009
  8. Junio C HamanoDec 28, 2009
  9. Documentation: always respect core.worktree if setNguyễn Thái Ngọc Duy, Dec 29, 2009
  10. Junio C HamanoDec 29, 2009
  11. Robin RosenbergDec 29, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.