From: Taylor Blau <me@ttaylorr.com>
To: Caleb White <cdwhite3@pm.me>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Eric Sunshine <sunshine@sunshineco.com>,
Phillip Wood <phillip.wood123@gmail.com>,
shejialuo <shejialuo@gmail.com>,
Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Subject: Re: [PATCH 1/2] worktree: add CLI/config options for relative path linking
Date: Sun, 27 Oct 2024 20:17:24 -0400 [thread overview]
Message-ID: <Zx7YFPE5tjr/bn2s@nand.local> (raw)
In-Reply-To: <20241025-wt_relative_options-v1-1-c3005df76bf9@pm.me>
On Fri, Oct 25, 2024 at 10:29:37PM +0000, Caleb White wrote:
> This patch introduces the `--[no-]relative-paths` CLI option for
> `git worktree {add, move, repair}` commands, as well as the
> `worktree.useRelativePaths` configuration setting. When enabled,
> these options allow worktrees to be linked using relative paths,
> enhancing portability across environments where absolute paths
> may differ (e.g., containerized setups, shared network drives).
>
> Using the `--relative-paths` option with `worktree {move, repair}`
> will convert absolute paths to relative ones, while `--no-relative-paths`
> does the reverse. For cases where users want consistency in path
> handling, the config option `worktree.useRelativePaths` provides
> a persistent setting.
>
> A new helper function, `write_worktree_linking_files()`, centralizes
> the logic for computing and writing either relative or absolute
> paths, based on the provided configuration. This function accepts
> `strbuf` pointers to both the worktree’s `.git` link and the
> repository’s `gitdir`, and then writes the appropriate path to each.
Looking at the patch below, it is quite large, and I wonder if it would
benefit from being split into smaller pieces. Perhaps factoring out
write_worktree_linking_files() in a separate patch would be a good start
here?
Thanks,
Taylor
next prev parent reply other threads:[~2024-10-28 0:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-25 22:29 [PATCH 0/2] Allow relative worktree linking to be configured by the user Caleb White
2024-10-25 22:29 ` [PATCH 1/2] worktree: add CLI/config options for relative path linking Caleb White
2024-10-28 0:17 ` Taylor Blau [this message]
2024-10-28 0:34 ` Taylor Blau
2024-10-28 16:35 ` Caleb White
2024-10-28 16:54 ` Taylor Blau
2024-10-28 18:50 ` Caleb White
2024-10-28 1:16 ` Caleb White
2024-10-25 22:29 ` [PATCH 2/2] worktree: add `relativeWorktrees` extension Caleb White
2024-10-28 0:20 ` Taylor Blau
2024-10-28 1:14 ` Caleb White
2024-10-28 17:08 ` Taylor Blau
2024-10-28 19:00 ` Caleb White
2024-10-28 23:36 ` Taylor Blau
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=Zx7YFPE5tjr/bn2s@nand.local \
--to=me@ttaylorr.com \
--cc=cdwhite3@pm.me \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kristofferhaugsbakk@fastmail.com \
--cc=phillip.wood123@gmail.com \
--cc=shejialuo@gmail.com \
--cc=sunshine@sunshineco.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).