From: Martin Mares Date: Fri, 29 Jun 2012 20:09:40 +0000 (+0200) Subject: Update2: Include mail headers with description of the repo and of the current push X-Git-Tag: v1.0~5 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=55a0ef1be66fe64137011c5625a49c4451172a64;p=git-tools.git Update2: Include mail headers with description of the repo and of the current push --- diff --git a/update2 b/update2 index 5178f9b..aa0fea3 100755 --- a/update2 +++ b/update2 @@ -8,6 +8,7 @@ use warnings; use Getopt::Long; use IO::File; use File::Temp; +use POSIX; my $mail_to; my $subject_prefix = "GIT"; @@ -30,6 +31,9 @@ my ($ref, $old, $new) = @ARGV; $ref =~ s{^refs/heads/}{} or exit 0; $old ne $new or exit 0; +my $repo = POSIX::getcwd(); +$repo =~ s{.*/}{}; + my $subj = '[' . $subject_prefix . ($ref eq 'master' ? '' : "/$ref") . ']'; my $out = File::Temp->new() or die; my $outname = $out->filename; @@ -130,8 +134,12 @@ if (defined $mail_to) { system 'mutt', '-F/dev/null', '-x', - '-e', - 'set charset="utf-8"; set send_charset="us-ascii:iso-8859-2:utf-8"', + '-e', 'set charset="utf-8"', + '-e', 'set send_charset="us-ascii:iso-8859-2:utf-8"', + '-e', "my_hdr X-Git-Repo: $repo", + '-e', "my_hdr X-Git-Branch: $ref", + '-e', "my_hdr X-Git-Old-SHA: $old", + '-e', "my_hdr X-Git-New-SHA: $new", '-s', $subj, $mail_to; } else {