Re: [PATCH] Fix core.worktree being used when GIT_DIR is not set
- From
Robin Rosenberg <robin.rosenberg@dewire.com>
- Date
- Dec 28, 2009, 00:08 UTC
- Message-ID
- <200912280108.10113.robin.rosenberg@dewire.com>
- In-Reply-To
- <7viqbsw2vn.fsf@alter.siamese.dyndns.org>
söndagen den 27 december 2009 21.58.20 skrev Junio C Hamano:
Show 15 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes: > > According to config.txt: > >> core.worktree:: > >> Set the path to the working tree. The value will not be > >> used in combination with repositories found automatically in > >> a .git directory (i.e. $GIT_DIR is not set). > > > > This behavior was changed after e90fdc3 (Clean up work-tree handling - > > 2007-08-01) and 9459aa7 (Do check_repository_format() early (re-fix) - > > 2007-12-05). If core.worktree is set, even if git_dir automatically > > found (and git_work_tree_cfg set), git_work_tree_cfg will be reset to > > core.worktree. This makes core.worktree effective even if GIT_DIR is > > not set, in contrast to config.txt. > > > > This patch makes sure it only checks for core.worktree if GIT_DIR is set.
...
Show 6 quoted lines
> > Given these background, I am not sure the "fix" is addressing the right > issue. What does it mean to have "core.worktree" in a configuration file, > but that configuration file was found in a "git directory" that was found > thorough the repository discovery process due to lack of $GIT_DIR? There > are only two cases I can see:
I'm inclined towards fixing the docs. Overriding a config setting in non- intuitive and nobody has complained.
-- robin