Re: [PATCH 2/2] worktree: add `relativeWorktrees` extension

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux