summaryrefslogtreecommitdiff
path: root/git-dch
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2007-10-07 14:26:01 +0200
committerGuido Guenther <agx@sigxcpu.org>2007-10-07 14:26:01 +0200
commit470ce29ec7877705c844474a2fd89869aea0406d (patch)
treee43da6820d62f8c91f98b26eb7cbf86d04f4ad8d /git-dch
parent4a3353067dd006b10150d5964d282cd0818a6b0a (diff)
downloadgit-buildpackage-470ce29ec7877705c844474a2fd89869aea0406d.tar.gz
git-buildpackage-470ce29ec7877705c844474a2fd89869aea0406d.tar.bz2
git-buildpackage-470ce29ec7877705c844474a2fd89869aea0406d.zip
Allow to specify paths to look at: git-dch path1 path2
Again handy if upstream uses git, simply use: git-dch debian to only have the changes in the debian/ subdir recorded.
Diffstat (limited to 'git-dch')
-rwxr-xr-xgit-dch15
1 files changed, 7 insertions, 8 deletions
diff --git a/git-dch b/git-dch
index 46052fc3..32fb50b1 100755
--- a/git-dch
+++ b/git-dch
@@ -31,10 +31,10 @@ from gbp.deb_utils import parse_changelog
snapshot_re = "\s*\*\* SNAPSHOT build @(?P<commit>[a-z0-9]+)\s+\*\*"
-def get_log(start, end, options):
+def get_log(start, end, options, paths):
"""Get the shortlog from commit 'start' to commit 'end'"""
try:
- p1 = subprocess.Popen("git-log %s %s...%s" % (options, start, end), shell=True,
+ p1 = subprocess.Popen("git-log %s %s...%s -- %s" % (options, start, end, paths), shell=True,
stdout=subprocess.PIPE)
p2 = subprocess.Popen(["git-shortlog"], stdin=p1.stdout, stdout=subprocess.PIPE)
changes = p2.communicate()[0].split('\n')
@@ -180,7 +180,8 @@ def main(argv):
changelog = 'debian/changelog'
until = 'HEAD'
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='')
+ parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [options] paths')
parser.add_config_file_option(option_name="debian-branch", dest='debian_branch',
help="branch the debian patch is being developed on, default is '%(debian-branch)s'")
@@ -205,10 +206,6 @@ def main(argv):
if options.verbose:
gbpc.Command.verbose = True
- if args:
- parser.print_help()
- raise GbpError
-
try:
repo = GitRepository('.')
except GitRepositoryError:
@@ -234,7 +231,9 @@ def main(argv):
if not since:
since = build_tag(options.debian_tag, cp['Version'])
- changes = get_log(since, until, options.git_log)
+ if args:
+ print "Only looking for changes on '%s'" % " ".join(args)
+ changes = get_log(since, until, options.git_log, " ".join(args))
if changes:
if cp['Distribution'] != "UNRELEASED":
add_changelog_section(distribution="UNRELEASED", msg="UNRELEASED")