Skip to content

package-source-builder: Fix tally-revision on new repositories

The tally-revision script used to skip revision for which a package has been built already does not really work on new repositories that do not contain any tag.

In that scenario it fails like this:

$ tally-revision

  • git rev-parse -q --verify HEAD
  • HEAD=2a2235e0f7182fcc619e755eb14de0983753c6cf
  • git describe --tags --match apertis/* --abbrev=0 fatal: No names found, cannot describe anything. +TAGS=

That's because set -e causes the failing git describe invocation to exit the script with an error, which is then interpreted as "skip this revision", preventing the pipeline from running on new repositories with no tags.

For an example job failing, see https://gitlab.apertis.org/alee/didcot/-/jobs/278693#L41

Edited by Emanuele Aina

Merge request reports

Loading