From aae9b921686054070c6897fd64cb80af90cf92d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Guido=20G=C3=BCnther?= Date: Sat, 30 Jul 2011 11:35:08 +0200 Subject: [PATCH] gbp.git.GitRepository: Add first_parent option to commits() Git-Dch: Ignore --- gbp/git.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gbp/git.py b/gbp/git.py index 11c027e..1e06d55 100644 --- a/gbp/git.py +++ b/gbp/git.py @@ -266,14 +266,23 @@ class GitRepository(object): else: return [] - def commits(self, since=None, until=None, paths=None, options=None): - """get commits from start to end touching paths""" + def commits(self, since=None, until=None, paths=None, options=None, + first_parent=False): + """ + get commits from since to until touching paths + + @param options: list of options past to git log + @type options: list of strings + """ args = ['--pretty=format:%H'] if options: args += options + if first_parent: + args += [ "--first-parent" ] + if since and until: args += ['%s..%s' % (since, until)] -- 2.7.4