Skip to content

Commit

Permalink
Numbering emails if more than 1 commit was pushed.
Browse files Browse the repository at this point in the history
  • Loading branch information
brasse committed Mar 3, 2010
1 parent e58bd06 commit b239ad9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions post_receive_email.py
Expand Up @@ -65,9 +65,14 @@ def git_rev_parse(hash, short=False):

def process_commits(commits, mailer):
for ref_name in commits.keys():
for commit in commits[ref_name]:
subject = 'ubet %s commit %s' % (ref_name,
git_rev_parse(commit, short=True))
use_index = len(commits[ref_name]) > 1
for i, commit in enumerate(commits[ref_name]):
commit_hash = git_rev_parse(commit, short=True)
if use_index:
subject = 'ubet %s commit (#%d) %s' % (ref_name, i + 1,
commit_hash)
else:
subject = 'ubet %s commit %s' % (ref_name, commit_hash)
message = git_show(commit)
mailer.send(subject, message)

Expand Down

0 comments on commit b239ad9

Please sign in to comment.