Problem
pgxntool doesn't work when the extension lives in a subdirectory of a git repo (monorepo pattern). Three things break:
-
setup.sh: [ -d .git ] || git init — attempts git init when run from a subdirectory since .git is in the parent. The README already says "This assumes that you've already initialized your extension in git", so the git init is unnecessary.
-
update-setup-files.sh: [[ -d ".git" ]] check fails in subdirectories. Should use git rev-parse --is-inside-work-tree which works anywhere in a worktree.
-
base.mk sync target: Hardcodes -P pgxntool in git subtree pull. This prefix is relative to git root, so in a subdirectory like subdir/, the prefix needs to be subdir/pgxntool. Should compute dynamically using git rev-parse --show-prefix.
Files to modify
setup.sh — Remove git init
update-setup-files.sh — Fix .git directory check
base.mk — Dynamic subtree prefix in sync targets
Dependencies
Depends on #16 (end-to-end test for make pgxntool-sync) being completed first, since the subdirectory work modifies the sync target's -P prefix logic and we want test coverage before changing it.
Problem
pgxntool doesn't work when the extension lives in a subdirectory of a git repo (monorepo pattern). Three things break:
setup.sh:[ -d .git ] || git init— attempts git init when run from a subdirectory since.gitis in the parent. The README already says "This assumes that you've already initialized your extension in git", so the git init is unnecessary.update-setup-files.sh:[[ -d ".git" ]]check fails in subdirectories. Should usegit rev-parse --is-inside-work-treewhich works anywhere in a worktree.base.mksync target: Hardcodes-P pgxntoolingit subtree pull. This prefix is relative to git root, so in a subdirectory likesubdir/, the prefix needs to besubdir/pgxntool. Should compute dynamically usinggit rev-parse --show-prefix.Files to modify
setup.sh— Remove git initupdate-setup-files.sh— Fix.gitdirectory checkbase.mk— Dynamic subtree prefix in sync targetsDependencies
Depends on #16 (end-to-end test for
make pgxntool-sync) being completed first, since the subdirectory work modifies the sync target's-Pprefix logic and we want test coverage before changing it.