Skip to content

Conversation

ziyao233
Copy link
Contributor

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 the core.abbrev with auto and let git decide how long the hash, 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] with the git configuration set globally.

Closes: pdm-project/pdm#3490

Copy link

netlify bot commented Apr 22, 2025

Deploy Preview for pdm-backend-docs ready!

Name Link
🔨 Latest commit f49d883
🔍 Latest deploy log https://app.netlify.com/sites/pdm-backend-docs/deploys/68072452605c9d0008d7aa71
😎 Deploy Preview https://deploy-preview-286--pdm-backend-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ziyao233 ziyao233 force-pushed the override-git-core-abbrev branch from 2216822 to 73b1ada Compare April 22, 2025 05:09
Copy link

netlify bot commented Apr 22, 2025

Deploy Preview for pdm-backend-docs ready!

Name Link
🔨 Latest commit 2216822
🔍 Latest deploy log https://app.netlify.com/sites/pdm-backend-docs/deploys/6807245acb369d0008f78c0f
😎 Deploy Preview https://deploy-preview-286--pdm-backend-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 22, 2025

Deploy Preview for pdm-backend-docs ready!

Name Link
🔨 Latest commit 80bfe11
🔍 Latest deploy log https://app.netlify.com/sites/pdm-backend-docs/deploys/680724fc1e0ee30008325f7f
😎 Deploy Preview https://deploy-preview-286--pdm-backend-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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 <[email protected]>
@ziyao233 ziyao233 force-pushed the override-git-core-abbrev branch from 0d6e4f0 to f45f0a0 Compare April 22, 2025 05:11
@frostming frostming merged commit 60d94c8 into pdm-project:main Apr 22, 2025
23 checks passed
@fumiyas
Copy link

fumiyas commented Aug 11, 2025

FYI. Old Git versions (<2.11.0) don't support core.abbrev=auto in git-config(1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Versions generated from Git SCM may be Inconsistent with core.abbrev set

3 participants