moonchen commented on PR #13302: URL: https://github.com/apache/trafficserver/pull/13302#issuecomment-4754221006
## Testing Tested the format workflows from a fresh clone, comparing `master` with this PR. **Does clang-format get found and run?** — verified two ways: cache-dir resolution, and a real `pre-commit` commit. | Workflow | `master` | PR #13302 | |---|---|---| | No worktree | ✅ works | ✅ works | | Linked worktree | ❌ `No clang-format found` | ✅ works | clang-format is installed once under the common `.git/fmt`; on `master` a linked worktree looks in `.git/worktrees/<name>/fmt` instead and misses it. **Everything checked:** | Check | | | :-- | :-: | | git 2.43.0 (current) | ✅ | | git 2.30.2 (pre-`--path-format`) | ✅ | | cmake 3.28.3 (the version named in #11495) | ✅ | | cmake format targets (`clang-format-install`, `clang-format-src`) run in a worktree | ✅ | | `--install` downloads to the common `.git/fmt` | ✅ | | worktree finds the `--install` download | ✅ | | no-path run formats the current worktree, not the main checkout (Copilot's note) | ✅ | **Addressing #11495:** that PR removed `git rev-parse --path-format=absolute --git-common-dir` because it "didn't work in cmake 3.28." The real cause is the git version, not cmake — `--path-format` only exists in git 2.31+, and on older git (2.30.2) that command returns the literal string `--path-format=absolute`. This PR gets the same result (the absolute path to the **shared** git dir) without that flag, using `cd "$(git rev-parse --git-common-dir)" && pwd` — so it restores worktree support and works on git back to 2.5. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
