Re: [PATCH v3 2/3] worktree: link worktrees with relative paths

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

 



Caleb White via B4 Relay <devnull+cdwhite3.pm.me@xxxxxxxxxx> writes:

> From: Caleb White <cdwhite3@xxxxx>
>
> Git currently stores absolute paths to both the main repository and

As always, drop "currently".

The usual way to compose a log message of this project is to

 - Give an observation on how the current system work in the present
   tense (so no need to say "Currently X is Y", just "X is Y"), and
   discuss what you perceive as a problem in it.

 - Propose a solution (optional---often, problem description
   trivially leads to an obvious solution in reader's minds).

 - Give commands to the codebase to "become like so".

in this order.

> linked worktrees. However, this causes problems when moving repositories

The above claim is way too strong.  When relative references are
used, you can move directories without problems only if you move all
the worktrees and the repository in unison without breaking their
relative locations, which is an exception and not the norm.

    The repository knows where its extra worktrees are by their
    absolute paths (and vice versa) to allow discovery of each
    other.  When a directory is moved, "git worktree repair" must be
    used to adjust these references.

    It however becomes possible, in a narrow special case, to do
    without "git worktree repair".  When the repository and the
    worktrees move in parallel without breaking their relative
    location, the repair operation becomes unneeded if we made them
    refer to each other using relative paths (think: tarring up both
    the reposity and the worktrees at the same time, and then
    untarring the result at a different place).

or something, perhaps.

> Although Git now writes relative paths, existing repositories with
> absolute paths are still supported. There are no breaking changes
> to workflows based on absolute paths, ensuring backward compatibility.

Good.  Being able to work with existing repositories is an absolute
requirement.  Are there good test cases?  I would imagine that you
would need to force a worktree and its repository to refer to each
other using absolute paths and then try to access with the updated
code, perhaps moving one of such "old-style" directory and then
using the updated "git worktree repair" and observing the result.
To allow such a test possible, you might even need an option to "git
worktree" to allow it to create these linkages using absolute paths,
not relative (and if you need to keep both possibilities anyway, you
might make the newer "relative" layout an optional feature,
triggered by a command line option given to "git worktree add" and
friends).

Have we considered how badly existing third-party tools, that has
learned to assume that the paths are aboslute, may break with this
change, though?  Or is this "we won't know until we inflict it on
real users and see who screams"?

Thanks.




[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