Commit 9743d0f6 authored by Ryan Jackson's avatar Ryan Jackson

Added support for new X-Git-Repo-Keyword header

Per-repository 'keywords' may now be configured by setting the
hooks.gitmail.keyword option.  One X-Git-Repo-Keyword header is added
to commit mails for each keyword specified.

The primary use case for this is to configure related repositories
with the same keyword(s), so that commit mails for those repositories
can be filtered with a single rule rather than one for each
repository.
parent f61a6288
......@@ -175,6 +175,13 @@ my $showcommit_extra = get_config("showcommitextra",undef);
#
my $exclude_repo = get_config("excluderepo",undef);
#
# If set, these values will be used to create 'X-Git-Repo-Keyword' headers, one
# for each value. This is to facilitate filtering of commit mails for those only
# interested in certain projects.
#
my @repo_keywords = get_config("keyword",undef);
######################################################################
# Constants
######################################################################
......@@ -910,6 +917,10 @@ sub send_mail($$$@) {
if (defined($reponame)) {
print MAIL "X-Git-Repo: $reponame\n";
}
if (@repo_keywords) {
@repo_keywords = map { split /\s+/ } @repo_keywords;
print MAIL "X-Git-Repo-Keyword: $_\n" for (@repo_keywords);
}
print MAIL "X-Git-Ref: $refname\n";
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment