diff options
| author | Holger Weiss <holger@zedat.fu-berlin.de> | 2009-10-24 11:44:16 +0200 |
|---|---|---|
| committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2009-10-24 11:44:16 +0200 |
| commit | db63fbfa036f5cd757aedf4547fef9e195a8c285 (patch) | |
| tree | b2bd33641cb4ded181d9808797047bade30fb0fa /tools | |
| parent | 5445b9769f254781e482062bacc6603a5cd63059 (diff) | |
| download | monitoring-plugins-db63fbfa036f5cd757aedf4547fef9e195a8c285.tar.gz | |
git-notify: Ignore "empty" commits
Omit notifications regarding commits which don't change the tree
whatsoever.
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/git-notify | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/git-notify b/tools/git-notify index 1b10f690..ccde4bee 100755 --- a/tools/git-notify +++ b/tools/git-notify | |||
| @@ -230,6 +230,12 @@ sub send_commit_notice($$) | |||
| 230 | my %info = get_object_info($obj); | 230 | my %info = get_object_info($obj); |
| 231 | my @notice = (); | 231 | my @notice = (); |
| 232 | 232 | ||
| 233 | open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", "--no-commit-id", $obj or die "cannot exec git-diff-tree"; | ||
| 234 | my $diff = join("", <DIFF>); | ||
| 235 | close DIFF; | ||
| 236 | |||
| 237 | return if length($diff) == 0; | ||
| 238 | |||
| 233 | push @notice, | 239 | push @notice, |
| 234 | "Module: $repos_name", | 240 | "Module: $repos_name", |
| 235 | "Branch: $ref", | 241 | "Branch: $ref", |
| @@ -247,10 +253,6 @@ sub send_commit_notice($$) | |||
| 247 | push @notice, join("", <STAT>); | 253 | push @notice, join("", <STAT>); |
| 248 | close STAT; | 254 | close STAT; |
| 249 | 255 | ||
| 250 | open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", "--no-commit-id", $obj or die "cannot exec git-diff-tree"; | ||
| 251 | my $diff = join( "", <DIFF> ); | ||
| 252 | close DIFF; | ||
| 253 | |||
| 254 | if (($max_diff_size == -1) || (length($diff) < $max_diff_size)) | 256 | if (($max_diff_size == -1) || (length($diff) < $max_diff_size)) |
| 255 | { | 257 | { |
| 256 | push @notice, $diff; | 258 | push @notice, $diff; |
