Re: [PATCH 3/3] setup: always honor GIT_WORK_TREE and core.worktree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/1/19 Jonathan Nieder <jrnieder@xxxxxxxxx>:
> @@ -411,6 +411,16 @@ static const char *setup_discovered_git_dir(const char *gitdir,
> Â Â Â Âif (check_repository_format_gently(gitdir, nongit_ok))
> Â Â Â Â Â Â Â Âreturn NULL;
>
> + Â Â Â /* Accept --work-tree to support old scripts that played with fire. */
> + Â Â Â if (getenv(GIT_WORK_TREE_ENVIRONMENT) || git_work_tree_cfg) {

Can we leave git_work_tree_cfg out? If this code is to support misused
scripts, then $GIT_WORK_TREE alone ought to be enough. I don't think
any scripts would use core.worktree. Most of worktree headache comes
from core.worktree, not $GIT_WORK_TREE. Granted though the situation
is better now that we don't set worktree in setup_git_directory().

> + Â Â Â Â Â Â Â warning("pretending GIT_DIR was supplied alongside GIT_WORK_TREE");

What if core.worktree is set, not $GIT_WORK_TREE? In my opinion

> + Â Â Â Â Â Â Â if (offset != len && !is_absolute_path(gitdir))
> + Â Â Â Â Â Â Â Â Â Â Â gitdir = xstrdup(make_absolute_path(gitdir));

The behavior regarding relative $GIT_WORK_TREE before nd/setup series
is inconsistent. If setup_git_directory() is used, work_tree is
relative to user's cwd. In other cases, when get_git_work_tree() is
called, work_tree is made absolute relative to _current_ cwd (usually
at discovered work_tree root). Which way do you want to keep?
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]