From: Duy Nguyen <pclouds@gmail.com>
To: Daniel Hahler <genml+git-2014@thequod.de>
Cc: git@vger.kernel.org
Subject: Re: Bug: relative core.worktree is resolved from symlink and not its target
Date: Sun, 9 Feb 2014 16:08:03 +0700 [thread overview]
Message-ID: <20140209090803.GA24578@lanh> (raw)
In-Reply-To: <52F0BEF7.5020600@thequod.de>
On Tue, Feb 04, 2014 at 11:20:39AM +0100, Daniel Hahler wrote:
> Hi,
>
> when using a submodule "sm", there is a relative worktree in its config:
>
> .git/modules/sm/config:
> [core]
> worktree = ../../../smworktree
>
> git-new-worktree (from contrib) symlinks this config the new worktree.
>
> From inside the new worktree, git reads the config, but resolves the
> relative worktree setting based on the symlink's location.
Hmm.. core.worktree is relative to $GIT_DIR. Whether "config" is a
symlink should have no effects.
$ pwd
/tmp/abc
$ ls -l .git/config
lrwxrwxrwx 1 pclouds users 11 Feb 9 15:57 .git/config -> /tmp/config
$ cat /tmp/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
worktree = ../../worktree
$ ls -l /tmp/worktree/
total 4
-rw-r--r-- 1 pclouds users 5 Feb 9 15:59 abc
$ ~/w/git/git ls-files -o
abc
Maybe it's something else. Could you produce a small test case?
> A fix would be to resolve any relative worktree setting based on the
> symlink target's location (the actual config file), and not from the
> symlink.
>
> This is with git version 1.8.5.3.
--
Duy
next prev parent reply other threads:[~2014-02-09 9:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 10:20 Bug: relative core.worktree is resolved from symlink and not its target Daniel Hahler
2014-02-09 9:08 ` Duy Nguyen [this message]
2014-02-17 9:36 ` Daniel Hahler
2014-02-17 12:30 ` Duy Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140209090803.GA24578@lanh \
--to=pclouds@gmail.com \
--cc=genml+git-2014@thequod.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).