You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "masaori335 (via GitHub)" <gi...@apache.org> on 2024/01/26 02:25:31 UTC
[PR] CMake: use --git-common-dir to find the git dir [trafficserver]
masaori335 opened a new pull request, #11015:
URL: https://github.com/apache/trafficserver/pull/11015
Prior to the change, cmake format target didn't work under git worktree directories. Because the `$(git rev-parse --show-toplevel)/.git` is the git directory of the current worktree directory. It's not the git "common" directory that has formatters.
If you're not using git worktree, this change has no impact.
# Details with example
```
$ git worktree list
/src/apache/trafficserver e2ff288e0 [master] ///< original repo
/src/apache/trafficserver-dev e7c152da6 [dev] ///< worktree
# under the /src/apache/trafficserver-dev dir
$ cmake --build build-dev -t format
...
[0/9] Installing clang-formatninja: error: mkdir(/src/apache/trafficserver-dev/.git/fmt): Not a directory
ninja: build stopped: .
$ git rev-parse --show-toplevel
/src/apache/trafficserver-dev
$ cat .git
gitdir: /src/trafficserver/.git/worktrees/trafficserver-dev
$ git rev-parse --git-common-dir
/src/apache/trafficserver/.git
```
# Refs.
> --show-toplevel
Show the (by default, absolute) path of the top-level directory of the working tree. If there is no working tree, report an error.
> --git-common-dir
Show $GIT_COMMON_DIR if defined, else $GIT_DIR.
https://git-scm.com/docs/git-rev-parse
https://git-scm.com/docs/git-worktree
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CMake: use --git-common-dir to find the git dir [trafficserver]
Posted by "masaori335 (via GitHub)" <gi...@apache.org>.
masaori335 merged PR #11015:
URL: https://github.com/apache/trafficserver/pull/11015
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org