Package: git-buildpackage
Version: 0.6.15
Severity: wishlist
Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
I am using gbp with an upstream branch that is pulled from git repository
(there are no release tarballs). Upstream tags are not annotated,
but git-dch searches only for annotated tags which are normally
signed when git-import-orig is run.
* What was the outcome of this action?
git-dch added a version with "21.6-2" suffix, but
I would expect it to add "21.7-1", because there is "upstream/21.7"
tag (which is not annotated, though).
* What outcome did you expect instead?
I expected git-dch to look at lightweight tags as well.
I attach a trivial patch that does exactly that.
Cheers,
Tomasz
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'stable'), (200, 'unstable'), (1,
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.13-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages git-buildpackage depends on:
ii devscripts 2.14.6
ii git 1:2.1.0~rc1-1
ii man-db 2.6.7.1-1
ii python 2.7.8-1
ii python-dateutil 1.5+dfsg-1
ii python-pkg-resources 5.5.1-1
Versions of packages git-buildpackage recommends:
ii cowbuilder 0.73
ii pristine-tar 1.32
Versions of packages git-buildpackage suggests:
ii python-notify 0.1.1-3
ii unzip 6.0-12
-- Configuration Files:
/etc/git-buildpackage/gbp.conf changed [not included]
-- no debconf information
>From 2d0809c4192c822bf49ecd1716e5998001c89141 Mon Sep 17 00:00:00 2001
From: Tomasz Buchert <[email protected]>
Date: Mon, 25 Aug 2014 01:06:19 +0200
Subject: [PATCH] search for lightweight upstream tags as well
---
gbp/deb/git.py | 2 +-
gbp/git/repository.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gbp/deb/git.py b/gbp/deb/git.py
index 6105fe7..ec123d9 100644
--- a/gbp/deb/git.py
+++ b/gbp/deb/git.py
@@ -74,11 +74,11 @@ class DebianGitRepository(GitRepository):
@param epoch: an epoch to use
@returns: a new debian version
@raises GitRepositoryError: if no upstream tag was found
"""
pattern = upstream_tag_format % dict(version='*')
- tag = self.find_tag(commit, pattern=pattern)
+ tag = self.find_tag(commit, pattern=pattern, tags=True)
version = self.tag_to_version(tag, upstream_tag_format)
version += "-1"
if epoch:
version = "%s:%s" % (epoch, version)
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 23f9482..322b2aa 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -695,22 +695,22 @@ class GitRepository(object):
if ret:
raise GitRepositoryError("Can't describe %s. Git error: %s" % \
(commitish, err.strip()))
return tag.strip()
- def find_tag(self, commit, pattern=None):
+ def find_tag(self, commit, pattern=None, tags=False):
"""
Find the closest tag to a given commit
@param commit: the commit to describe
@type commit: C{str}
@param pattern: only look for tags matching I{pattern}
@type pattern: C{str}
@return: the found tag
@rtype: C{str}
"""
- return self.describe(commit, pattern, abbrev=0)
+ return self.describe(commit, pattern, abbrev=0, tags=tags)
def get_tags(self, pattern=None):
"""
List tags
--
2.1.0.rc1