diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-10-03 22:35:48 (GMT) |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-10-03 22:35:48 (GMT) |
commit | a143ae580de0cf62e2de3d584cf615a7983031f3 (patch) | |
tree | 62bad3aefaaf7b50dbef0b29173084adeecd17c9 | |
parent | d6772d6012da2bbffc0fe8912044f98b1df74b89 (diff) | |
download | site-a143ae580de0cf62e2de3d584cf615a7983031f3.tar.gz |
git-notify: Replace Gitweb URLs with cgit URLs
We use cgit, not Gitweb.
TODO: Make this configurable.
-rwxr-xr-x | libexec/git-notify | 12 |
1 files changed, 6 insertions, 6 deletions
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($$@) | |||
434 | ($reftype eq "tag" ? "Tag:" : "Branch:") . $refname, | 434 | ($reftype eq "tag" ? "Tag:" : "Branch:") . $refname, |
435 | @notice, | 435 | @notice, |
436 | ($action ne "removed" and $gitweb_url) | 436 | ($action ne "removed" and $gitweb_url) |
437 | ? "URL: ${gitweb_url}a=shortlog;h=$ref" : undef), | 437 | ? "URL: ${gitweb_url}/log/?id=$ref" : undef), |
438 | "", | 438 | "", |
439 | "The $refname $reftype has been $action."); | 439 | "The $refname $reftype has been $action."); |
440 | 440 | ||
@@ -460,7 +460,7 @@ sub send_commit_notice($$) | |||
460 | close REVPARSE or die $! ? "Cannot execute rev-parse: $!" : "rev-parse exited with status: $?"; | 460 | close REVPARSE or die $! ? "Cannot execute rev-parse: $!" : "rev-parse exited with status: $?"; |
461 | } | 461 | } |
462 | $obj_string = $obj if not defined $obj_string; | 462 | $obj_string = $obj if not defined $obj_string; |
463 | $url = "${gitweb_url}a=$info{type};h=$obj_string"; | 463 | $url = "${gitweb_url}/$info{type}/?id=$obj_string"; |
464 | } | 464 | } |
465 | 465 | ||
466 | if ($info{"type"} eq "tag") | 466 | if ($info{"type"} eq "tag") |
@@ -508,7 +508,7 @@ sub send_commit_notice($$) | |||
508 | } | 508 | } |
509 | else | 509 | else |
510 | { | 510 | { |
511 | push @notice, "Diff: ${gitweb_url}a=commitdiff;h=$obj_string" if $gitweb_url; | 511 | push @notice, "Diff: ${gitweb_url}/diff/?id=$obj_string" if $gitweb_url; |
512 | } | 512 | } |
513 | $subject = $info{"author_name"} . ": " unless $omit_author; | 513 | $subject = $info{"author_name"} . ": " unless $omit_author; |
514 | } | 514 | } |
@@ -565,7 +565,7 @@ sub send_cia_notice($$) | |||
565 | 565 | ||
566 | push @cia_text, | 566 | push @cia_text, |
567 | " </files>", | 567 | " </files>", |
568 | $gitweb_url ? " <url>" . xml_escape("${gitweb_url}a=commit;h=$commit") . "</url>" : "", | 568 | $gitweb_url ? " <url>" . xml_escape("${gitweb_url}/commit/?id=$commit") . "</url>" : "", |
569 | " </commit>", | 569 | " </commit>", |
570 | " </body>", | 570 | " </body>", |
571 | " <timestamp>" . $info{"author_date"} . "</timestamp>", | 571 | " <timestamp>" . $info{"author_date"} . "</timestamp>", |
@@ -582,7 +582,7 @@ sub send_global_notice($$$) | |||
582 | 582 | ||
583 | foreach my $rev (@$notice) | 583 | foreach my $rev (@$notice) |
584 | { | 584 | { |
585 | $rev =~ s/^commit /URL: ${gitweb_url}a=commit;h=/ if $gitweb_url; | 585 | $rev =~ s/^commit /URL: ${gitweb_url}\/commit\/?id=/ if $gitweb_url; |
586 | } | 586 | } |
587 | 587 | ||
588 | mail_notification($commitlist_address, "New commits on branch $ref", "text/plain; charset=UTF-8", @$notice); | 588 | mail_notification($commitlist_address, "New commits on branch $ref", "text/plain; charset=UTF-8", @$notice); |
@@ -662,7 +662,7 @@ umask( $mode_mask ); | |||
662 | 662 | ||
663 | # append repository path to URL | 663 | # append repository path to URL |
664 | if ($gitweb_url) { | 664 | if ($gitweb_url) { |
665 | $gitweb_url .= $sourceforge ? "/$repos_name;" : "/$repos_name.git/?"; | 665 | $gitweb_url .= $sourceforge ? "/$repos_name" : "/$repos_name.git"; |
666 | } | 666 | } |
667 | 667 | ||
668 | if (@ARGV) | 668 | if (@ARGV) |