Subject: Re: [PATCH 11/17] t5509: specify bare repository path explicitly

From: Junio C Hamano <[email-masked]>
Date: Fri, 03 Apr 2026 11:17:22 -0700

Johannes Schindelin <[email-masked]> writes:

> 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.