Draft: doc/conf.py: fetch copyright year from git commit
Using Git commit to avoid problems with reproducible builds; with fallback to system time in case Git is not available for whatever reason.
Merge request reports
Activity
requested review from @vcunat
Normal packages are built from tarballs, i.e. without git repo. Therefore this would hurt package reproducibility, I believe. EDIT: at least, if the package was using this; docs are not often built in them.
Edited by Vladimír ČunátWell, we could generate some sort of
.git-info
file in the archive, which could contain some brief information about the current commit (I'd imagine full hash, commit message, committer, timestamp - just some potentially generally useful info), then use that as the preferred input fordoc/conf.py
?Maybe even have it as
Fetch from .git-info
; if that's not available,Fetch from 'git show'
; if that's not available,Fallback to system time
.
added 1 commit
- 6f16cb63 - scripts, doc: generate vcs info for archives, use for copyright year
Added a simple generator for a
.kr-vcs-info
JSON file that contains some basic information about the current commit. This gets copied into Meson's staging directory. It works, but the copy script uses an environment variable that is only provided since Meson0.54
, and we currently support Meson>=0.49
.The
doc/conf.py
script is able to fetch the year from Git itself, the.kr-vcs-info
file, and falls back to system time if none of the two are available.added 1 commit
- f945f6cf - doc/conf.py: tolerate complete non-existence of Git
added 1 commit
- 700e4f40 - fixup! scripts, doc: generate vcs info for archives, use for copyright year
marked this merge request as draft from 700e4f40
Superseded by !1368 (merged), closing.