Page MenuHomePhabricator

Find the per-worktree .git directory when using git-worktree
AbandonedPublic

Authored by arichardson on Aug 11 2020, 3:52 PM.
Tags
None
Referenced Files
F14052935: D21438.diff
Fri, Nov 15, 11:35 AM
F14038434: D21438.diff
Sun, Nov 10, 11:38 PM
F14024678: D21438.diff
Thu, Nov 7, 11:30 AM
F14014069: D21438.id51016.diff
Sat, Nov 2, 9:42 PM
F14014063: D21438.id.diff
Sat, Nov 2, 9:42 PM
F14014062: D21438.id51014.diff
Sat, Nov 2, 9:42 PM
F14013582: D21438.diff
Sat, Nov 2, 7:51 AM
F14008914: D21438.id51016.diff
Wed, Oct 30, 7:53 AM
Subscribers

Details

Summary

When using git-worktree, $vcs_root/.git is not a directory but a file and
this breaks e.g. arc get-config/set-config. To handle this case we can
use git rev-parse --git-dir to get the per-worktree .git directory.

Test Plan

arc set-config --local history.immutable false failed inside a git worktree before, now it writes the value and arc get-config returns the new value.

Diff Detail

Repository
rARC Arcanist
Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24831
Build 34257: arc lint + arc unit

Event Timeline

There's currently no customer interest in worktree support. The use cases in T9924 seem flimsy to me so I don't currently plan to support worktrees in the absence of customer interest. See also ArcanistGitWorkingCopy.

I don't expect any sophisticated git-worktree support. This is a simple change that allows arc get-config/set-config to work correctly when invoked from a worktree. It might also fix some other cases where arc expects $identity->localMetaDir to be a directory which previously wasn't the case for worktrees.

I don't believe this is related to T9924 and I would be very unhappy if that behaviour was implemented. I rely on my worktrees remaining available at all times. I work on multiple projects with very large .git directory that are forked from the same root project so I use worktrees to save disk space and allow cherry-picking between the different forks, not as arc "feature branches".

To be completely clear: I'm not going to accept any features upstream which zero customers are interested in. It doesn't matter if they're simple or complicated. If no customers want it, it isn't coming upstream.