From: Duy Nguyen <pclouds@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Stéphane Klein" <contact@stephane-klein.info>,
"Git Mailing List" <git@vger.kernel.org>
Subject: Re: Feature request: use relative path in worktree config files
Date: Tue, 11 Oct 2016 18:16:11 +0700 [thread overview]
Message-ID: <CACsJy8AZVWNQNgsw21EF2UOk42oFeyHSRntw_rpeZz_OT1xdMw@mail.gmail.com> (raw)
In-Reply-To: <xmqq60p0f3un.fsf@gitster.mtv.corp.google.com>
On Tue, Oct 11, 2016 at 1:36 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Duy Nguyen <pclouds@gmail.com> writes:
>
>>> 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.
>
> Hmm, are they really welcome?
>
> Is an invocation of "git worktree add" really the right point in the
> workflow to decide if these references to other repositories should
> be relative or absolute? When you are moving referrer, it is more
> convenient if the reference uses absolute path to name the
> referrent. When you are moving both referrer and referrent, it is
> more convenient to use relative.
You're right (thanks for thinking this through). There's another case
that benefits from relative paths besides Stephane's use case: if you
put the entire repo and all associated worktrees on a portable disk,
the disk could be mounted on different paths each time, so absolute
paths do not fly.
> I somehow doubt that users know which future move they would be
> making when doing "git worktree add".
>
> To me, this almost looks like a need for a new subcommand to "git
> worktree" that lets you move existing worktree to elsewhere, or turn
> absolute reference to relative and vice versa.
An alternative is always use relative paths. You have to move
worktrees with "git worktree move". Which simplifies things a bit
(absolute -> relative conversion on existing worktrees could be done
at move time). But I'm not sure if it's a good idea to kill manual
move support. If you accidentally move a worktree, it'll be
disconnected and you have to fix that by yourself.
--
Duy
prev parent reply other threads:[~2016-10-11 11:18 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
2016-10-09 11:39 ` Stéphane Klein
2016-10-10 18:36 ` Junio C Hamano
2016-10-11 11:16 ` Duy Nguyen [this message]
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=CACsJy8AZVWNQNgsw21EF2UOk42oFeyHSRntw_rpeZz_OT1xdMw@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=contact@stephane-klein.info \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).