From f8e9091dd4db62c47395361b732190bc61681a8a Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Fri, 22 Dec 2017 01:50:35 -0800 Subject: [PATCH 1/2] Revert "Do not use double quotes on git command with --format option" This reverts commit 3385305da01ff72809e47bdbeb0422859faa5414. --- readthedocs/vcs_support/backends/git.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readthedocs/vcs_support/backends/git.py b/readthedocs/vcs_support/backends/git.py index 895df4fef23..2230f47f054 100644 --- a/readthedocs/vcs_support/backends/git.py +++ b/readthedocs/vcs_support/backends/git.py @@ -86,8 +86,8 @@ def tags(self): # of annotated tags pointing to tagged commits. retcode, stdout, _ = self.run( 'git', 'for-each-ref', - '--format=%(if)%(*objectname)%(then)%(*objectname)' - '%(else)%(objectname)%(end) %(refname)', + '--format="%(if)%(*objectname)%(then)%(*objectname)' + '%(else)%(objectname)%(end) %(refname)"', 'refs/tags') # error (or no tags found) if retcode != 0: From 092d8ae2765facbd8830368404e854f215b44265 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Fri, 22 Dec 2017 01:51:20 -0800 Subject: [PATCH 2/2] Revert "Merge pull request #3302 from techtonik/patch-2" This reverts commit 1b3404b51966144afebe3ec25e8f05b03098ffa8, reversing changes made to 26102e0faa72632a8dc62a8e00c541dd5340972e. --- readthedocs/vcs_support/backends/git.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/readthedocs/vcs_support/backends/git.py b/readthedocs/vcs_support/backends/git.py index 2230f47f054..52010d28486 100644 --- a/readthedocs/vcs_support/backends/git.py +++ b/readthedocs/vcs_support/backends/git.py @@ -80,15 +80,7 @@ def clone(self): @property def tags(self): - # Hash for non-annotated tag is its commit hash, but for annotated tag it - # points to tag itself, so we need to dereference annotated tags. - # The output format is the same as `git show-ref --tags`, but with hashes - # of annotated tags pointing to tagged commits. - retcode, stdout, _ = self.run( - 'git', 'for-each-ref', - '--format="%(if)%(*objectname)%(then)%(*objectname)' - '%(else)%(objectname)%(end) %(refname)"', - 'refs/tags') + retcode, stdout, _ = self.run('git', 'show-ref', '--tags') # error (or no tags found) if retcode != 0: return [] @@ -96,7 +88,7 @@ def tags(self): def parse_tags(self, data): """ - Parses output of `git show-ref --tags`, eg: + Parses output of show-ref --tags, eg: 3b32886c8d3cb815df3793b3937b2e91d0fb00f1 refs/tags/2.0.0 bd533a768ff661991a689d3758fcfe72f455435d refs/tags/2.0.1