~mdw
/
stgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ask git for author and committer name
[stgit]
/
stgit
/
commands
/
mail.py
diff --git
a/stgit/commands/mail.py
b/stgit/commands/mail.py
index
176d7a2
..
5d71657
100644
(file)
--- a/
stgit/commands/mail.py
+++ b/
stgit/commands/mail.py
@@
-127,14
+127,18
@@
def __get_sender():
configuration file
"""
if config.has_option('stgit', 'sender'):
configuration file
"""
if config.has_option('stgit', 'sender'):
- return config.get('stgit', 'sender')
- elif config.has_option('stgit', 'authname') \
- and config.has_option('stgit', 'authemail'):
- return '%s <%s>' % (config.get('stgit', 'authname'),
- config.get('stgit', 'authemail'))
+ sender = config.get('stgit', 'sender')
else:
else:
+ try:
+ sender = str(git.user())
+ except git.GitException:
+ sender = str(git.author())
+
+ if not sender:
raise CmdException, 'unknown sender details'
raise CmdException, 'unknown sender details'
+ return sender
+
def __parse_addresses(addresses):
"""Return a two elements tuple: (from, [to])
"""
def __parse_addresses(addresses):
"""Return a two elements tuple: (from, [to])
"""