Makefile: fix docker-check/docker-indent from a git worktree - #1184
Merged
Conversation
citus_indent calls `git ls-files` to find the files it should check.
When run from a git worktree, the worktree's own .git is only a
pointer file ("gitdir: <main-repo>/.git/worktrees/<name>") to a path
outside the mounted volume, so that call failed with "not a git
repository" / "could not list files under source control" inside the
container.
Resolve the real common git dir on the host (git rev-parse
--git-common-dir) and bind-mount it into the container at the
identical absolute path, so the worktree's pointer still resolves.
This is a no-op for a plain (non-worktree) checkout, where the common
dir already lives under the mounted source tree.
Also document the make docker-check/docker-indent shortcut in
CONTRIBUTING.md, which previously only described installing
citus_indent locally.
dimitri
force-pushed
the
fix-citus-indent-worktree-mount
branch
from
August 2, 2026 15:26
cdc44d2 to
c65936f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make docker-check/make docker-indent(the documented way to runcitus_indent locally without installing it) failed when run from a git
worktree:
citus_indent calls
git ls-filesto find which files to check. Aworktree's own
.gitis just a pointer file (gitdir: <main-repo>/.git/ worktrees/<name>) to a path outside the container's mounted volume, sothat call fails inside the container.
Fix
Resolve the real common git dir on the host via
git rev-parse --git-common-dirand bind-mount it into the container at the identicalabsolute path, so the worktree's pointer still resolves. This is a no-op
for a plain (non-worktree) checkout, where the common dir already lives
under the mounted source tree — verified both cases work.
Also documents the
make docker-check/make docker-indentshortcut inCONTRIBUTING.md, which previously only described installing citus_indent
locally.
Verification
make docker-checkfrom both a plain checkout and agit worktreecheckout — both pass (exit 0).
make docker-indent— no unexpected reformatting.ci/banned.h.sh— unaffected, still passes.