mail.sh: show a more sane summary of changes for new branches
commit483d80e230b5a9a3466b20052ce70edfbbcd4903
authorKyle J. McKay <mackyle@gmail.com>
Thu, 18 Aug 2016 10:33:37 +0000 (18 03:33 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Thu, 18 Aug 2016 10:33:37 +0000 (18 03:33 -0700)
treeae6a1893fdedaf832cc96b0fef1cdd019313adb8
parentb62ee5659e40112ea6e6f24b2a5c8febcd1ce8a8
mail.sh: show a more sane summary of changes for new branches

Originally mail.sh never showed any summary of changes for new branch
notifications.  This was non-optimal.

Subsequently a summary of changes was added showing the difference between
an empty tree and the new branch tip.  This is correct for branches which
are not forks of previously existing revisions in the repository, but is
suboptimal for new branches that are.

Instead, take advantage of the show_new_revisions logic that already
exists and show the diff between the parent of the last shown revision
and the new branch tip.  If the last shown revision is a root revision
show the differences from an empty tree instead.  In the case where the
last shown revision is a merge suppress the summary of changes as there's
not an obviously correct diff to show in that case. (diff-tree could
probably be used passing it --stdin -c and the new tip revision along with
the last shown revision's parents but then how does one explain that
clearly and is that really the correct thing to do in this case anyway?)

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
taskd/mail.sh