summaryrefslogtreecommitdiffstats
path: root/tools/git-notify
diff options
context:
space:
mode:
Diffstat (limited to 'tools/git-notify')
-rwxr-xr-xtools/git-notify10
1 files changed, 2 insertions, 8 deletions
diff --git a/tools/git-notify b/tools/git-notify
index d53461c..548f7da 100755
--- a/tools/git-notify
+++ b/tools/git-notify
@@ -47,9 +47,6 @@ my $cia_address = "cia\@cia.navi.cx";
47# debug mode 47# debug mode
48my $debug = 0; 48my $debug = 0;
49 49
50# number of generated (non-CIA) notifications
51my $sent_notices = 0;
52
53# configuration parameters 50# configuration parameters
54 51
55# base URL of the gitweb repository browser (can be set with the -u option) 52# base URL of the gitweb repository browser (can be set with the -u option)
@@ -393,7 +390,6 @@ sub send_ref_notice($$@)
393 390
394 mail_notification($commitlist_address, "$refname $reftype $action", 391 mail_notification($commitlist_address, "$refname $reftype $action",
395 "text/plain; charset=us-ascii", @notice); 392 "text/plain; charset=us-ascii", @notice);
396 $sent_notices++;
397} 393}
398 394
399# send a commit notice to a mailing list 395# send a commit notice to a mailing list
@@ -467,7 +463,6 @@ sub send_commit_notice($$)
467 $subject .= ": " . truncate_str(${$info{"log"}}[0],50); 463 $subject .= ": " . truncate_str(${$info{"log"}}[0],50);
468 $_ = decode($info{"encoding"}, $_) for @notice; 464 $_ = decode($info{"encoding"}, $_) for @notice;
469 mail_notification($commitlist_address, $subject, "text/plain; charset=UTF-8", @notice); 465 mail_notification($commitlist_address, $subject, "text/plain; charset=UTF-8", @notice);
470 $sent_notices++;
471} 466}
472 467
473# send a commit notice to the CIA server 468# send a commit notice to the CIA server
@@ -538,7 +533,6 @@ sub send_global_notice($$$)
538 } 533 }
539 534
540 mail_notification($commitlist_address, "New commits on branch $ref", "text/plain; charset=UTF-8", @$notice); 535 mail_notification($commitlist_address, "New commits on branch $ref", "text/plain; charset=UTF-8", @$notice);
541 $sent_notices++;
542} 536}
543 537
544# send all the notices 538# send all the notices
@@ -583,7 +577,7 @@ sub send_all_notices($$$)
583 { 577 {
584 send_global_notice( $refname, $old_sha1, $new_sha1 ) if $commitlist_address; 578 send_global_notice( $refname, $old_sha1, $new_sha1 ) if $commitlist_address;
585 } 579 }
586 else 580 elsif (@$commits > 0)
587 { 581 {
588 foreach my $commit (@$commits) 582 foreach my $commit (@$commits)
589 { 583 {
@@ -591,7 +585,7 @@ sub send_all_notices($$$)
591 send_cia_notice( $refname, $commit ) if $cia_project_name; 585 send_cia_notice( $refname, $commit ) if $cia_project_name;
592 } 586 }
593 } 587 }
594 if ($sent_notices == 0 and $commitlist_address) 588 elsif ($commitlist_address)
595 { 589 {
596 @notice = ( "Old SHA1: $old_sha1", "New SHA1: $new_sha1" ); 590 @notice = ( "Old SHA1: $old_sha1", "New SHA1: $new_sha1" );
597 send_ref_notice( $ref, "modified", @notice ); 591 send_ref_notice( $ref, "modified", @notice );