Re: [PATCH 11/17] t5509: specify bare repository path explicitly
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 3, 2026, 18:17 UTC
- Message-ID
- <xmqqqzovnc25.fsf@gitster.g>
- In-Reply-To
- <f43a7add-6a0c-2368-1b4c-655dfa6361e7@gmx.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 7 quoted lines
> It would be indeed more conservative, and it even results in less changes > when done in a more elegant fashion, by appending `--git-dir=.` after the > `-C pushee`, as the patches "t2400: explicitly specify bare repo for `git > worktree add`" and "t2406: use `--git-dir=.` for bare repository worktree > repair" already do. That will not only result in vastly less changed lines > (and hence less cognitive load on any reviewer), but also avoid the > proposed subshell. I'll go with `--git-dir=.`, then.
Ah, yes, with or without -C shouldn't affect the decision to use "--git-dir=$path" in the first place, and the ones that need the change to explicitly say "--git-dir=$path" in this series are all the ones that wants to be at the level where HEAD and refs/ exists and access the repository contents (as if it were a bare repository even when it is a part of a repository with a worktree, or it may be going there into a real bare repository), by definition what we need to add is "--git-dir=.", no arbitrary $path adjusted for each case is needed.
Makes sense.
Assuming that we want to tighten the rule and prepare for the tightening before it happens, that is. I personally do not think it is a bad move, but I do not recall we had much discussion to gain a community consensus to go in that direction.