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
F18732109: D21438.diff
Tue, Sep 30, 4:21 PM
F18674008: D21438.diff
Thu, Sep 25, 12:53 PM
F18659023: D21438.id51016.diff
Tue, Sep 23, 9:29 AM
F18654471: D21438.diff
Mon, Sep 22, 10:42 AM
F18618953: D21438.id.diff
Mon, Sep 15, 1:24 AM
F18596206: D21438.diff
Sat, Sep 13, 12:01 AM
F18576959: D21438.id51016.diff
Wed, Sep 10, 5:23 PM
F18571193: D21438.id51016.diff
Wed, Sep 10, 4:48 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.