- 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'))
- else:
+ sender=config.get('stgit.sender')
+ if not sender:
+ try:
+ sender = str(git.user())
+ except git.GitException:
+ sender = str(git.author())
+
+ if not sender: