From a143ae580de0cf62e2de3d584cf615a7983031f3 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Fri, 4 Oct 2013 00:35:48 +0200 Subject: git-notify: Replace Gitweb URLs with cgit URLs We use cgit, not Gitweb. TODO: Make this configurable. diff --git a/libexec/git-notify b/libexec/git-notify index fda8e5b..60d91ae 100755 --- a/libexec/git-notify +++ b/libexec/git-notify @@ -434,7 +434,7 @@ sub send_ref_notice($$@) ($reftype eq "tag" ? "Tag:" : "Branch:") . $refname, @notice, ($action ne "removed" and $gitweb_url) - ? "URL: ${gitweb_url}a=shortlog;h=$ref" : undef), + ? "URL: ${gitweb_url}/log/?id=$ref" : undef), "", "The $refname $reftype has been $action."); @@ -460,7 +460,7 @@ sub send_commit_notice($$) close REVPARSE or die $! ? "Cannot execute rev-parse: $!" : "rev-parse exited with status: $?"; } $obj_string = $obj if not defined $obj_string; - $url = "${gitweb_url}a=$info{type};h=$obj_string"; + $url = "${gitweb_url}/$info{type}/?id=$obj_string"; } if ($info{"type"} eq "tag") @@ -508,7 +508,7 @@ sub send_commit_notice($$) } else { - push @notice, "Diff: ${gitweb_url}a=commitdiff;h=$obj_string" if $gitweb_url; + push @notice, "Diff: ${gitweb_url}/diff/?id=$obj_string" if $gitweb_url; } $subject = $info{"author_name"} . ": " unless $omit_author; } @@ -565,7 +565,7 @@ sub send_cia_notice($$) push @cia_text, " ", - $gitweb_url ? " " . xml_escape("${gitweb_url}a=commit;h=$commit") . "" : "", + $gitweb_url ? " " . xml_escape("${gitweb_url}/commit/?id=$commit") . "" : "", " ", " ", " " . $info{"author_date"} . "", @@ -582,7 +582,7 @@ sub send_global_notice($$$) foreach my $rev (@$notice) { - $rev =~ s/^commit /URL: ${gitweb_url}a=commit;h=/ if $gitweb_url; + $rev =~ s/^commit /URL: ${gitweb_url}\/commit\/?id=/ if $gitweb_url; } mail_notification($commitlist_address, "New commits on branch $ref", "text/plain; charset=UTF-8", @$notice); @@ -662,7 +662,7 @@ umask( $mode_mask ); # append repository path to URL if ($gitweb_url) { - $gitweb_url .= $sourceforge ? "/$repos_name;" : "/$repos_name.git/?"; + $gitweb_url .= $sourceforge ? "/$repos_name" : "/$repos_name.git"; } if (@ARGV) -- cgit v0.10-9-g596f