projects
/
tools
/
git-buildpackage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
631c347
)
add find_tag(branch)
author
Guido Guenther
<agx@sigxcpu.org>
Mon, 22 Sep 2008 17:54:00 +0000
(19:54 +0200)
committer
Guido Guenther
<agx@sigxcpu.org>
Mon, 22 Sep 2008 18:07:08 +0000
(20:07 +0200)
gbp/git_utils.py
patch
|
blob
|
history
diff --git
a/gbp/git_utils.py
b/gbp/git_utils.py
index 670d9903999df16a161f6161fa386410aa0980f9..9885fc9c4f1d490943a865742f5b35f28ff12ffc 100644
(file)
--- a/
gbp/git_utils.py
+++ b/
gbp/git_utils.py
@@
-111,6
+111,13
@@
class GitRepository(object):
for line in commit:
yield line
+ def find_tag(self, branch):
+ "find the closest tag to a branch's head"
+ tag, ret = self.__git_getoutput('describe', [ "--abbrev=0", branch ])
+ if ret:
+ raise GitRepositoryError, "can't find tag for %s" % branch
+ return tag[0].strip()
+
def write_tree(self):
"""write out the current index, return the SHA1"""
tree, ret = self.__git_getoutput('write-tree')