diff options
author | Lingchaox Xin <lingchaox.xin@intel.com> | 2013-06-20 09:34:01 +0800 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2013-09-04 22:32:55 +0200 |
commit | eca5a3365c5461519fd23ab2e85e5de9195da007 (patch) | |
tree | bcdd2f3f957799771b86d473e90c192cb6a1a84d /gbp/git | |
parent | 07b30540133f193702190570b2a0e1819a327dff (diff) |
GitRepository.describe: add 'tags' and 'extra-match' options
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/git')
-rw-r--r-- | gbp/git/repository.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 79492a1..9c55dfd 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -625,7 +625,7 @@ class GitRepository(object): return [ False, True ][len(out)] def describe(self, commitish, pattern=None, longfmt=False, always=False, - abbrev=None): + abbrev=None, tags=False, exact_match=False): """ Describe commit, relative to the latest tag reachable from it. @@ -639,6 +639,11 @@ class GitRepository(object): @type always: C{bool} @param abbrev: abbreviate sha1 to given length instead of the default @type abbrev: None or C{long} + @param tags: enable matching a lightweight (non-annotated) tag + @type tags: C{bool} + @param exact_match: only output exact matches (a tag directly + references the supplied commit) + @type exact_match: C{bool} @return: tag name plus/or the abbreviated sha1 @rtype: C{str} """ @@ -652,6 +657,8 @@ class GitRepository(object): elif abbrev is not None: args.add('--abbrev=%s' % abbrev) args.add_true(always, '--always') + args.add_true(tags, '--tags') + args.add_true(exact_match, '--exact-match') args.add(commitish) tag, err, ret = self._git_inout('describe', args.args, |