I think it'd be useful to be able to identify exactly which git commit was used to produce a tarball. This would be especially useful when downloading snapshot tarballs where that's not entirely clear, but can also be used to verify that the release tarballs matches what's expected (in the extremely rare case that a tarball is rewrapped for example).
What do people think of the attached? -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/
diff --git a/GNUmakefile.in b/GNUmakefile.in index 2352fc1171..f63fb037ae 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -114,6 +114,8 @@ distdir: cp $(distdir)/doc/src/sgml/INSTALL $(distdir)/ $(MAKE) -C $(distdir) distclean rm -f $(distdir)/README.git + git rev-parse HEAD > $(distdir)/.gitrevision + if test -n "`git status --untracked-files=no --porcelain`"; then sed -i "s/$$/ (modified)/" $(distdir)/.gitrevision ; fi distcheck: dist rm -rf $(dummy)