Skip to content

Commit 015134e

Browse files
committed
When diffs are too large to include, still show a stats summary in the
mails. Patch from Vincent Danen.
1 parent 4b02688 commit 015134e

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

CHANGES

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11

2+
0.3-18 | 2012-07-05 08:32:48 -0700
3+
4+
* When diffs are too large to include, still show a stats summary in the
5+
mails. (Vincent Danen)
6+
7+
* New option 'mergediffs'.
8+
9+
``--mergediffs <branches>``
10+
Lists branches for which merges should include the full diff,
11+
including all changes that are already part of branch commits.
12+
``<branches>`` is a list of command-separated names of heads
13+
to treat this way. (Robin Sommer)
14+
215
0.3-16 | 2011-08-18 10:31:05 -0700
316

417
* Now showing diffs for merges as well. (Robin Sommer)
@@ -29,7 +42,6 @@
2942
now for one of the --allchanges heads, will have only the latter
3043
in the mail subject. (Robin Sommer)
3144

32-
3345
0.3-5 | 2011-07-22 15:59:12 -0700
3446

3547
* Further tweaking allchanges. We now don't do real diffs anymore at

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3-16
1+
0.3-18

btest

Whitespace-only changes.

git-notifier

+9-4
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def entryDeleted(key, value):
334334

335335
# Sends a mail for a notification consistent of two parts: (1) the output of a
336336
# show command, and (2) the output of a diff command.
337-
def sendChangeMail(rev, subject, heads, show_cmd, diff_cmd):
337+
def sendChangeMail(rev, subject, heads, show_cmd, diff_cmd, stat_cmd):
338338

339339
(out, fname) = generateMailHeader(subject)
340340

@@ -365,8 +365,10 @@ def sendChangeMail(rev, subject, heads, show_cmd, diff_cmd):
365365
size = os.path.getsize(tname)
366366

367367
if size > Config.maxdiffsize:
368+
(tmp, tname) = makeTmp()
369+
diff = git(stat_cmd, stdout_to=tmp)
370+
tmp.close()
368371
footer = "\nDiff suppressed because of size. To see it, use:\n\n git %s" % diff_cmd
369-
tname = None
370372

371373
print >>out, Separator
372374

@@ -388,6 +390,7 @@ def sendChangeMail(rev, subject, heads, show_cmd, diff_cmd):
388390
print >>out, "-- "
389391
print >>out, "debug: show_cmd = git %s" % show_cmd
390392
print >>out, "debug: diff_cmd = git %s" % diff_cmd
393+
print >>out, "debug: stat_cmd = git %s" % stat_cmd
391394

392395
sendMail(out, fname)
393396

@@ -416,8 +419,9 @@ def commit(current, rev, force=False, subject_head=None):
416419

417420
show_cmd = "show -s --no-color --find-copies-harder --pretty=medium %s" % rev
418421
diff_cmd = "diff-tree --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol %s %s" % (merge_diff, rev)
422+
stat_cmd = "diff --stat --no-color --find-copies-harder --ignore-space-at-eol ^%s~1 %s " % (rev, rev)
419423

420-
sendChangeMail(rev, subject, heads, show_cmd, diff_cmd)
424+
sendChangeMail(rev, subject, heads, show_cmd, diff_cmd, stat_cmd)
421425

422426
# Sends a diff between two revisions.
423427
#
@@ -438,8 +442,9 @@ def diff(head, first, last):
438442

439443
show_cmd = "show -s --no-color --find-copies-harder --pretty=medium %s" % last
440444
diff_cmd = "diff --patch-with-stat -m --no-color --find-copies-harder --ignore-space-at-eol %s %s" % (first, last)
445+
stat_cmd = "diff --stat -m --no-color --find-copies-harder --ignore-space-at-eol %s %s" % (first, last)
441446

442-
sendChangeMail(last, subject, heads, show_cmd, diff_cmd)
447+
sendChangeMail(last, subject, heads, show_cmd, diff_cmd, stat_cmd)
443448

444449
# Sends pair-wise diffs for a path of revisions. Also records all revision on
445450
# the path as seen.

setup.py

Whitespace-only changes.

0 commit comments

Comments
 (0)