Repository navigation
Commit 290cd22
committed
gh-159440: Pass --work-tree to the git commands used for the version tag
The `GITTAG` build stamp uses `git --git-dir $(srcdir)/.git describe --all --always --dirty`. `--git-dir` does not imply a work tree, so git falls back to the current directory. In an out-of-tree build `make` runs in the build tree, where none of the tracked files exist, so the internal `diff-index HEAD` of `--dirty` reports every tracked file as deleted and the tag always comes out as `heads/<branch>-dirty` — even for a pristine checkout. In-tree builds never hit this, and `GITVERSION`/`GITBRANCH` don't touch the work tree, so only the dirty check was wrong.
Pass `--work-tree \$(srcdir)` for all three commands. The semantics of `-dirty` are preserved (a genuinely modified source tree still reports `-dirty`), and in-tree builds are unchanged because `$(srcdir)` is `.`.1 parent a6b4aa6 commit 290cd22
2 files changed
Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
0 commit comments