summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 40ef916)
raw | patch | inline | side by side (parent: 40ef916)
author | Holger Weiss <holger@zedat.fu-berlin.de> | |
Sat, 7 Nov 2009 01:23:32 +0000 (02:23 +0100) | ||
committer | Holger Weiss <holger@zedat.fu-berlin.de> | |
Sat, 7 Nov 2009 01:23:32 +0000 (02:23 +0100) |
If the new "-A" option is specified (or "notify.omitAuthor" is set), the
author name will be omitted from the subject of e-mail notifications.
author name will be omitted from the subject of e-mail notifications.
tools/git-notify | patch | blob | history |
diff --git a/tools/git-notify b/tools/git-notify
index 289a5f645a0f9f69b427edab8f6a063138d2c47f..e5094b4134a7f05f106bc5cd9d7d68a1fbeb0309 100755 (executable)
--- a/tools/git-notify
+++ b/tools/git-notify
#
# Usage: git-notify [options] [--] old-sha1 new-sha1 refname
#
+# -A Omit the author name from the mail subject
# -C Show committer in the body if different from the author
# -c name Send CIA notifications under specified project name
# -m addr Send mail notifications to specified address
# configuration parameters
+# omit the author from the mail subject (can be set with the -A option)
+my $omit_author = git_config( "notify.omitauthor" );
+
# show the committer if different from the author (can be set with the -C option)
my $show_committer = git_config( "notify.showcommitter" );
sub usage()
{
print "Usage: $0 [options] [--] old-sha1 new-sha1 refname\n";
+ print " -A Omit the author name from the mail subject\n";
print " -C Show committer in the body if different from the author\n";
print " -c name Send CIA notifications under specified project name\n";
print " -m addr Send mail notifications to specified address\n";
my $arg = shift @ARGV;
if ($arg eq '--') { last; }
+ elsif ($arg eq '-A') { $omit_author = 1; }
elsif ($arg eq '-C') { $show_committer = 1; }
elsif ($arg eq '-c') { $cia_project_name = shift @ARGV; }
elsif ($arg eq '-m') { $commitlist_address = shift @ARGV; }
"",
join "\n", @{$info{"log"}};
- $subject = "Tag " . $info{"tag"} . ": " . $info{"tagger_name"};
+ $subject = "Tag " . $info{"tag"} . ": ";
+ $subject .= $info{"tagger_name"} . ": " unless $omit_author;
}
else
{
{
push @notice, "Diff: $gitweb_url/?a=commitdiff;h=$obj_string" if $gitweb_url;
}
- $subject = $info{"author_name"};
+ $subject = $info{"author_name"} . ": " unless $omit_author;
}
- $subject .= ": " . truncate_str(${$info{"log"}}[0],50);
+ $subject .= truncate_str(${$info{"log"}}[0],50);
$_ = decode($info{"encoding"}, $_) for @notice;
mail_notification($commitlist_address, $subject, "text/plain; charset=UTF-8", @notice);
}