diff --git a/utils/git-notify b/utils/git-notify
index 87de54b2..48555e7c 100755
--- a/utils/git-notify
+++ b/utils/git-notify
@@ -52,6 +52,10 @@ my $debug = 0;
# base URL of the gitweb repository browser (can be set with the -u option)
my $gitweb_url = git_config( "notify.baseurl" );
+# The git server is behind gitlab
+my $is_gitlab = git_config( "notify.isgitlab" ) || "";
+my $gitlab_owner = git_config( "notify.gitlabowner" ) || "";
+
# default repository name (can be changed with the -r option)
my $repos_name = git_config( "notify.repository" ) || get_repos_name();
@@ -147,6 +151,7 @@ sub parse_options()
elsif ($arg eq '-r') { $repos_name = shift @ARGV; }
elsif ($arg eq '-s') { $max_diff_size = shift @ARGV; }
elsif ($arg eq '-u') { $gitweb_url = shift @ARGV; }
+ elsif ($arg eq '-g') { $is_gitlab = shift @ARGV; }
elsif ($arg eq '-i') { push @include_list, shift @ARGV; }
elsif ($arg eq '-x') { push @exclude_list, shift @ARGV; }
elsif ($arg eq '-X') { push @revlist_options, "--no-merges"; }
@@ -260,7 +265,7 @@ sub send_commit_notice($$)
"Module: $repos_name",
"Branch: $ref",
"Tag: $obj",
- $gitweb_url ? "URL: $gitweb_url;a=tag;h=$obj\n" : "",
+ $gitweb_url ? "URL: $gitweb_url". ($is_gitlab ? "/tag/$obj\n" : ";a=tag;h=$obj\n") : "",
"Tagger: " . $info{"tagger"},
"Date: " . format_date($info{"tagger_date"},$info{"tagger_tz"}),
"",
@@ -273,7 +278,7 @@ sub send_commit_notice($$)
"Module: $repos_name",
"Branch: $ref",
"Commit: $obj",
- $gitweb_url ? "URL: $gitweb_url;a=commit;h=$obj\n" : "",
+ $gitweb_url ? "URL: $gitweb_url". ($is_gitlab ? "/commit/$obj\n" : ";a=commit;h=$obj\n") : "",
"Author: " . $info{"author"},
"Date: " . format_date($info{"author_date"},$info{"author_tz"}),
"",
@@ -296,7 +301,7 @@ sub send_commit_notice($$)
}
else
{
- push @notice, "Diff: $gitweb_url;a=commitdiff;h=$obj" if $gitweb_url;
+ push @notice, "Diff: $gitweb_url". ($is_gitlab ? "/commit/$obj" : ";a=commit;h=$obj") if $gitweb_url;
}
$subject = "Git commit ($repos_name/$ref): " . ${$info{"log"}}[0];
@@ -352,7 +357,7 @@ sub send_cia_notice($$)
push @cia_text,
" ",
- $gitweb_url ? " " . xml_escape("$gitweb_url;a=commit;h=$commit") . "" : "",
+ $gitweb_url ? " " . xml_escape("$gitweb_url". ($is_gitlab ? "/commit/$commit" : ";a=commit;h=$commit")) . "" : "",
" ",
"