From ac2132faed6df87557420acf15519952b3a3d905 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 14 May 2017 12:55:46 -0400 Subject: [PATCH] Fix the output of the deprecation script. Some tags (e.g., 'rebase_here') may not be version numbers so we should not drop the first letter. --- contrib/utilities/print_deprecated.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/utilities/print_deprecated.py b/contrib/utilities/print_deprecated.py index 642173c135..5e679379bb 100644 --- a/contrib/utilities/print_deprecated.py +++ b/contrib/utilities/print_deprecated.py @@ -81,11 +81,12 @@ class DeprecatedDeclaration(object): self.output_time = datetime.datetime.utcfromtimestamp(self.epoch_time) git_tag_output = subprocess.check_output(["git", "tag", "--contains", - self.commit_hash]) + self.commit_hash, + "-l", "v[0-9].[0-9].[0-9]"]) git_tag_output = decode_and_split(git_tag_output) - relevant_tags = [tag for tag in git_tag_output if "rc" not in tag] - if relevant_tags: - self.release = relevant_tags[0][1:] # skip the prepended 'v' + if git_tag_output: + # matched tags must start with 'v[0-9]': skip the v + self.release = git_tag_output[0][1:] else: self.release = "" -- 2.39.5