diff options
author | Guido Guenther <agx@sigxcpu.org> | 2007-10-07 14:26:01 +0200 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2007-10-07 14:26:01 +0200 |
commit | 470ce29ec7877705c844474a2fd89869aea0406d (patch) | |
tree | e43da6820d62f8c91f98b26eb7cbf86d04f4ad8d /git-dch | |
parent | 4a3353067dd006b10150d5964d282cd0818a6b0a (diff) | |
download | git-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-x | git-dch | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -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") |