]> git.ipfire.org Git - thirdparty/git.git/commit
worktree: add relative cli/config options to `add` command
authorCaleb White <cdwhite3@pm.me>
Fri, 29 Nov 2024 22:22:55 +0000 (22:22 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Dec 2024 00:36:17 +0000 (09:36 +0900)
commitb7016344f1d4ef8457821e0436f335ec388b8dac
tree285880f500b6d9187ff3b5bbee93f9d2b3fa8d75
parent4dac9e3c01cf056edd315e0ed26e6df1c4d94571
worktree: add relative cli/config options to `add` command

This introduces the `--[no-]relative-paths` CLI option and
`worktree.useRelativePaths` configuration setting to the `worktree add`
command. 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).
Git still creates absolute paths by default, but these options allow
users to opt-in to relative paths if desired.

The t2408 test file is removed and more comprehensive tests are
written for the various worktree operations in their own files.

Signed-off-by: Caleb White <cdwhite3@pm.me>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/worktree.txt
Documentation/git-worktree.txt
builtin/worktree.c
t/t2400-worktree-add.sh
t/t2401-worktree-prune.sh
t/t2402-worktree-list.sh
t/t2408-worktree-relative.sh [deleted file]