Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ref-names from .git_archival.txt #444

Merged

Conversation

Mr0grog
Copy link
Contributor

@Mr0grog Mr0grog commented Jun 24, 2024

Howdy! @webknjaz recently posted about this issue with ref-names on a package I maintain, so I thought I’d also submit a change the recommendations/instructions/templates here (where I think I originally learned about .git_archival.txt).

It turns out that the ref-names field in .git_archival.txt will generate a different value depending on whether the commit that an archive was built from was the head of a branch at the time of archiving. That's a problem because it means someone trying to compare the hash digests of two archives built from the same commit might get different results based on when the archives were made, and not on any other intrinsic feature of the archives' content (e.g. if I wanted to verify a published archive from an official release of a package against an archive I made the package’s git repo, I might get a different hash). This removes the field in order to make Git archives a bit more stable and useful.

There’s some discussion and detail in setuptools-scm’s repo at: pypa/setuptools-scm#806. In particular, this comment about Arch Linux packaging was pretty convincing for me that this is an issue: pypa/setuptools-scm#806 (comment)

It turns out that the `ref-names` field in `.git_archival.txt` will generate a different value depending on whether the commit an archive was built from was the head of a branch at the time of archiving. That's a problem because it means someone trying to compare the hash signatures of two archives built from the same commit might get different results based on *when* the archives were made, and not on any other intrinsic feature of the archives' content. This removes the field in order to make Git archives a bit more stable and useful.
@henryiii henryiii merged commit 329170b into scientific-python:main Jun 27, 2024
16 checks passed
@henryiii
Copy link
Collaborator

Thanks!

@Mr0grog Mr0grog deleted the ref-names-is-not-stable-for-archives branch June 28, 2024 00:57
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.

2 participants