diff options
author | Robie Basak <rb-oss-1@justgohome.co.uk> | 2008-12-29 16:03:04 +0000 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2008-12-29 19:11:46 +0100 |
commit | 6f4af4ae55f12e4d1cb5a1426d039edf5d04dee8 (patch) | |
tree | 9f6e89f7ce8d8b976a9178c5b9c8396a9df54913 /git-dch | |
parent | 80921ebfda217cd9862f8a98d0c406b22404151b (diff) |
Use name and email from git
Closes: #509867
Diffstat (limited to 'git-dch')
-rwxr-xr-x | git-dch | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -82,11 +82,19 @@ def add_changelog_section(msg, distribution, author=None, email=None, version=No spawn_dch(msg=msg, newversion= True, version=version, author=author, email=email, distribution=distribution) -def fixup_trailer(): +def fixup_trailer(repo, git_author=False): """fixup the changelog trailer's comitter and email address - it might otherwise point to the last git committer instead of the person creating the changelog""" - spawn_dch(msg='') + author = email = None + if git_author: + try: author = repo.get_config('user.name') + except KeyError: pass + + try: email = repo.get_config('user.email') + except KeyError: pass + + spawn_dch(msg='', author=author, email=email) def head_commit(): @@ -279,6 +287,7 @@ def main(argv): help="mark as snapshot build") version_group.add_option("-N", "--new-version", dest="new_version", help="use this as base for the new version number") + version_group.add_config_file_option(option_name="git-author", dest="git_author", action="store_true") commit_group.add_config_file_option(option_name="meta", dest="meta", help="parse meta tags in commit messages, default is '%(meta)s'", action="store_true") commit_group.add_config_file_option(option_name="meta-closes", dest="meta_closes", @@ -355,7 +364,7 @@ def main(argv): if commits: shortlog_to_dch(repo, commits, options) - fixup_trailer() + fixup_trailer(repo, git_author=options.git_author) elif not first_commit: print "No changes detected from %s to %s." % (since, until) |