# Re: \[PATCH 3/4\] config: add repo\_config\_set\_worktree\_gently()

- From: Eric Sunshine \<hidden\>
- Date: 2021-12-21 05:59:54 
- List: git
- Page: https://ratatoskr.run/git/2021/12/7916432
- Thread: https://ratatoskr.run/git/2021/12/7916340/t.md

```text
On Mon, Dec 20, 2021 at 7:01 PM Eric Sunshine [ref] wrote:
> Regarding the actual "fix": we want a new utility function which
> enables per-worktree configuration and handles all the required
> bookkeeping actions described in git-worktree.txt. Specifically, if
> per-worktree configuration is not already enabled, the function will
> need to:
>
> (1) set `extensions.worktreeConfig=true` in .git/config
>
> (1) relocate `core.bare` from .git/config to .git/config.worktree if
> that key exists
>
> (2) relocate `core.worktree` from .git/config to .git/config.worktree
> if that key exists

A couple additional notes:

First, I can't count to three.

Second, item (0) in the above list would be to upgrade the repository
to version 1 since that's a prerequisite of using `extensions` (which
you know already, but I want to be clear for any other readers that
the new utility function should perform this step, as well).
```
