setuptools-scm: The documented `.git_archival.txt` causes git archives to change hash after first post-release commit is made
The documentation suggests using the following content for the .git_archival.txt file:
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
This means that if a tag is created on top of the main branch, the file initially contains e.g.:
ref-names: HEAD -> main, tag: v1
but once another commit is added and main no longer corresponds to the tag, it changes to:
ref-names: tag: v1
This causes the git archive hash to change. This is a problem for distributions like Gentoo that are using git archives generated by GitHub. The initial archive that we fetch once the release is made changes once upstream makes new commits.
See e.g.: https://bugs.gentoo.org/895910, https://bugs.gentoo.org/895712
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 16 (11 by maintainers)
Commits related to this issue
- dev-python/dask-expr: Rehash It's suffering from the setuptools-scm `.git_archival.txt` problem. Bug: https://github.com/pypa/setuptools_scm/issues/806 Closes: https://bugs.gentoo.org/927140 Signed-... — committed to gentoo/gentoo by mgorny 3 years ago
- py-pikepdf: update to 8.15.0 — committed to macports/macports-ports by Schamschula 3 years ago
- fix: make .git_archival.txt reproducible (#706) Context: https://github.com/pypa/setuptools_scm/issues/806 Closes #695 — committed to scikit-build/scikit-build-core by LecrisUT 3 years ago
- 🩹 make .git_archival.txt reproducible Context: https://github.com/pypa/setuptools_scm/issues/806 Signed-off-by: burgholzer <burgholzer@me.com> — committed to munich-quantum-toolkit/core by burgholzer 2 years ago
- Make Git archives reproducible Some time ago, it was discovered that Git archives having `ref-names: $Format:%D$` in `.git_archival.txt` may change when references existing in the repository change o... — committed to webknjaz/attrs by webknjaz 2 years ago
- 📦 Make Git archives reproducible Some time ago, it was discovered that Git archives having `ref-names: $Format:%D$` in `.git_archival.txt` may change when references existing in the repository chang... — committed to webknjaz/attrs by webknjaz 2 years ago
- 📦 Make Git archives reproducible (#1338) Some time ago, it was discovered that Git archives having `ref-names: $Format:%D$` in `.git_archival.txt` may change when references existing in the reposito... — committed to python-attrs/attrs by webknjaz 2 years ago
- 📦 Make git archives immutable Refs: * https://setuptools-scm.readthedocs.io/en/latest/usage/#git-archives * https://github.com/pypa/setuptools-scm/issues/806 — committed to ansible/pylibssh by webknjaz 2 years ago
Isn’t the need for
ref-namesobsoleted by the availability of thedescribe-nameI added to current versions of git (and which is specifically designed to be stable, at least if abbrev is used)?Maybe the template recommendation can simply phase out the old and unreliable ref-names formatter?