Commit 60d94c8
fix: Override Git config core.abbrev when reading version from SCM (#286)
* fix: Override Git config core.abbrev when reading version from SCM
The configuration represents the length commit hashes are abbreviated
to. As pdm-backend parses output of git describe to obtain the package
version, this configuration affects format of package versions that must
be represented with a commit hash part, which is quite surprising and
may introduce reproducible issues.
Let's override core.abbrev with auto and let git decide how long the
hash should be, keeping the format of generated version consistent
regardless of value of core.abbrev and fixing failures of
test__get_version_from_scm__returns_default_if_tag_cannot_be_parsed[git]
that occur when the git configuration is set globally.
Closes: pdm-project/pdm#3490
Signed-off-by: Yao Zi <ziyao@disroot.org>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Signed-off-by: Yao Zi <ziyao@disroot.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent 6cd4d32 commit 60d94c8
File tree
2 files changed
+6
-1
lines changed- src/pdm/backend/hooks/version
- tests/pdm/backend/hooks/version
2 files changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
143 | 146 | | |
144 | 147 | | |
145 | 148 | | |
| |||
0 commit comments