summaryrefslogtreecommitdiffhomepage
path: root/git-dch
diff options
context:
space:
mode:
authorRobie Basak <rb-oss-1@justgohome.co.uk>2008-12-29 16:03:04 +0000
committerGuido Guenther <agx@sigxcpu.org>2008-12-29 19:11:46 +0100
commit6f4af4ae55f12e4d1cb5a1426d039edf5d04dee8 (patch)
tree9f6e89f7ce8d8b976a9178c5b9c8396a9df54913 /git-dch
parent80921ebfda217cd9862f8a98d0c406b22404151b (diff)
Use name and email from git
Closes: #509867
Diffstat (limited to 'git-dch')
-rwxr-xr-xgit-dch15
1 files changed, 12 insertions, 3 deletions
diff --git a/git-dch b/git-dch
index 3ca423df..b426a60d 100755
--- a/git-dch
+++ b/git-dch
@@ -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)