git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Caleb White <cdwhite3@pm.me>
To: Taylor Blau <me@ttaylorr.com>
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 2/2] worktree: add `relativeWorktrees` extension
Date: Mon, 28 Oct 2024 01:14:51 +0000	[thread overview]
Message-ID: <D571HWYAD4MM.28JAS7D0Y6OI3@pm.me> (raw)
In-Reply-To: <Zx7YxLPItxvFJK62@nand.local>

On Sun Oct 27, 2024 at 7:20 PM CDT, Taylor Blau wrote:
> On Fri, Oct 25, 2024 at 10:29:47PM +0000, Caleb White wrote:
>> A new extension, `relativeWorktrees`, is added to indicate that at least
>> one worktree in the repository has been linked with relative paths. This
>> extension is automatically set when a worktree is created or repaired
>> using the `--relative-paths` option, or when the
>> `worktree.useRelativePaths` config is set to `true`.
>
> This approach feels like a very heavy hammer. I wonder if writing
> worktrees with relative paths by default was too aggressive of a step,
> and if we should instead make the new behavior opt-in rather than
> opt-out.

The v4 series of the original round added the cli options and updated
the relative worktrees to be opt-in. This patch keeps the git default
behavior of writing worktrees with absolute paths, and users can opt-in
via the `--relative-paths` cli option or the `worktree.useRelativePaths`
config.

> Saying that new worktrees are written with relative paths, and that
> creating a worktree with a new version of Git breaks reading the
> repository on older versions feels very unsatisfying to me.
>
>> The `relativeWorktrees` extension ensures older Git versions do not
>> attempt to automatically prune worktrees with relative paths, as they
>> would not not recognize the paths as being valid.
>
> This is the piece of information that I was missing in the earlier round
> when I merged that down. I think we need to take a step back and think
> about how to make this change safely in a way that doesn't break
> compatibility with older versions of Git.

Adding the extension was the direction suggested by Junio in the
previous round. Git did not account for the possibility of the linking
files containing relative paths, so there's really no way to make this
change without breaking compatibility with older versions of Git. Git
had to be taught how to handle files that could contain either absolute
or relative paths.

Best,
Caleb


  reply	other threads:[~2024-10-28  1:14 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
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 [this message]
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=D571HWYAD4MM.28JAS7D0Y6OI3@pm.me \
    --to=cdwhite3@pm.me \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kristofferhaugsbakk@fastmail.com \
    --cc=me@ttaylorr.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).