From: Duy Nguyen <pclouds@gmail.com>
To: "Stéphane Klein" <contact@stephane-klein.info>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Feature request: use relative path in worktree config files
Date: Sun, 9 Oct 2016 18:37:27 +0700 [thread overview]
Message-ID: <CACsJy8DGvyWz2_VBsEfmDWOPGUGAUhKYhCa1qLEMcOdn83ocSQ@mail.gmail.com> (raw)
In-Reply-To: <CADKxhpd-gDczp05Ny6wP57RXafWWCimArfA9ki2phh+-gHez4A@mail.gmail.com>
On Sun, Oct 9, 2016 at 6:22 PM, Stéphane Klein
<contact@stephane-klein.info> wrote:
> 2016-10-09 13:11 GMT+02:00 Duy Nguyen <pclouds@gmail.com>:
>
>>> * [worktree_foobar]/.git
>> This is made absolute on purpose. So that if you move worktree_foobar
>> away manually, it can still point back to
>> "[main_worktree]/.git/worktrees/[woktree_foobar]".
>
> Same problem if you move origin git repository.
We could fix up after moving the origin repository (because "gitdir"
file so far uses absolute paths, so we know where all the worktrees
are). But we have not done that.
>>> Why:
>>>
>>> 1. I configure worktree on my host
>>> 2. next I use this git working copy in Docker with volume share
>>> 3. next I've some git error in Docker because config files use absolute path
>>
>> I think the common way of dealing with this in docker is put things in
>> the same path where it actually is outside docker. If you have stuff
>> at /path/to/foo, then you create the same /path/to/foo inside docker
>> and bind the data to that path. Does that work?
>
> It's not always possible. I can't in my project.
>
> I think there are some pros and some cons for relative path and absolute path.
> Maybe append a "--relative" option with `git worktree add` ?
>
> I've converted all path to relative and all work with success.
>
> What do you think to append this --relative option.
Patches are welcome.
--
Duy
next prev parent reply other threads:[~2016-10-09 11:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-08 9:35 Feature request: use relative path in worktree config files Stéphane Klein
2016-10-08 19:54 ` Stéphane Klein
2016-10-09 11:11 ` Duy Nguyen
2016-10-09 11:22 ` Stéphane Klein
2016-10-09 11:37 ` Duy Nguyen [this message]
2016-10-09 11:39 ` Stéphane Klein
2016-10-10 18:36 ` Junio C Hamano
2016-10-11 11:16 ` 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=CACsJy8DGvyWz2_VBsEfmDWOPGUGAUhKYhCa1qLEMcOdn83ocSQ@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=contact@stephane-klein.info \
--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).