Jeff King wrote:
But reading the message for patch 4/4, I can't help but wonder if the
right way forward is for the git wrapper to _always_ find the repository
as the very first thing.
[...]
the worst case should be a little bit of
wasted effort.
This is a very useful thought. Git without the chdir() to toplevel
would be pleasanter, I think. (Yes, I realize you weren’t necessarily
suggesting suppressing a chdir_to_toplevel() in place of
setup_git_repository() and friends.)
Regarding the repository search: automounters can cause pain if
DISCOVERY_ACROSS_FILESYSTEM is set and GIT_CEILING_DIRECTORIES is not
set appropriately. An important script that does
tmpdir=$(mktemp -d)
cd "$tmpdir"
...
git diff --no-index a b
...
could hang indefinitely if some nut has created a named pipe at
/tmp/.git. I haven’t come up with any non far-fetched reason to mind
the repository search, though.
Will think about this.