]> arthur.barton.de Git - bup.git/commit
Avoid varying git archive content for ref; rework versioning
authorRob Browning <rlb@defaultvalue.org>
Sun, 5 Jul 2020 19:40:40 +0000 (14:40 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 5 Jul 2020 20:04:46 +0000 (15:04 -0500)
commit073f1e521cdfc39d302eaeac49745b1f1a25a1c0
treef40b92964dd88b695810622e8ca89591bbafdd0b
parentdd5351bd3ca731fa5caada713ce522af84edef58
Avoid varying git archive content for ref; rework versioning

Don't include the log --decorate names in the archive via export-subst
because they can change after the fact when new tags or branches are
added for a given hash -- for example, when we created the 0.30.x
branch after tagging 0.30.1.  Archives retrieved before the branch was
created would have a different set of NAMES in _release.py.

Move _release to source_info and add an optional checkout_info module.
source_info contains the (no longer variable) export-subst commit hash
and date values, and checkout_info contains the same data for a git
checkout.  Automatically update checkout_info whenever we're at the
top level of a git source tree, but don't include it in the archives.

Record the base version in version.py explicitly as either a release
version like 0.31, for an actual release (which must be committted
before tagging the release), or a development version like
0.31~ (indicating a version that's always less than 0.31).

Rework bup version to report the lib/version for an actual release, or
that version suffixed with the commit hash when running a non-release,
and add a "+" when uncommitted modifications are detected.  For
example:

      release: 0.31
  non-release: 0.31~4e4b9ba8689c93702743c8ecd49c5a7808a4d717
     modified: 0.31~4e4b9ba8689c93702743c8ecd49c5a7808a4d717+

Drop the --tag argument from bup version since the tags are variable,
and you can always ask git to describe the hash via

  git describe --always HASH

Add dev/refresh, similar to moreutils sponge, to handle file creation
safely, something we may want to deploy more widely (e.g. instead of
the $$/PID based tempfiles in the Makefile).

Thanks to Greg Troxel for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
12 files changed:
.gitignore
Makefile
configure-version [deleted file]
dev/refresh [new file with mode: 0755]
dev/update-checkout-info [new file with mode: 0755]
lib/bup/.gitattributes
lib/bup/_release.py [deleted file]
lib/bup/compat.py
lib/bup/source_info.py [new file with mode: 0644]
lib/bup/version.py
lib/cmd/version-cmd.py
note/0.31 [new file with mode: 0644]