Skip to content

Implement new predefined variable for "git describe" output

Wouter Verhelst requested to merge (removed):git-describe into master

What does this MR do?

Adds a new variable, CI_COMMIT_SHA_DESC, which contains the output of the git describe command. This output can be tuned by way of the GIT_DESCRIBE_FLAGS variable, if necessary.

Why was this MR needed?

git describe returns a name that concisely describes a git object in a more-or-less human-readable way. For a commit, the output of the command includes the most recent tag, and (if the most recent tag does not point to the commit being described), the number of commits since that tag, as well as a shortened version of the commit's SHA.

This value can be used as the version name in build artifacts or docker image tags.

Are there points in the code the reviewer needs to double check?

The variable name is perhaps not the best, hence the WIP.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

Edited by 🤖 GitLab Bot 🤖

Merge request reports