Skip to content

Commit

Permalink
xmppdiff: Make more diffs interesting
Browse files Browse the repository at this point in the history
Previously, only diffs that contained added *and* deleted lines were
considered "interesting".

This is a curious definition that I was unable to find in other hooks,
and definitely not what we wanted/expected.
  • Loading branch information
jplitza committed Apr 6, 2020
1 parent 17cdbc8 commit ff3cbc1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* MISC: scrubs macsec key from Arista EOS (@krisamundson)
* MISC: rubocop dependency now ~> 0.80.0
* MISC: rugged dependency now ~> 0.28.0
* MISC: xmppdiff now also shows diffs with only removed or added lines (@jplitza)

## 0.27.0

Expand Down
2 changes: 0 additions & 2 deletions lib/oxidized/hook/xmppdiff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ def run_hook(ctx)
interesting = diff[:patch].lines.to_a[4..-1].any? do |line|
["+", "-"].include?(line[0]) && (not ["#", "!"].include?(line[1]))
end
interesting &&= diff[:patch].lines.to_a[5..-1].any? { |line| line[0] == '-' }
interesting &&= diff[:patch].lines.to_a[5..-1].any? { |line| line[0] == '+' }

if interesting
log "Connecting to XMPP"
Expand Down

0 comments on commit ff3cbc1

Please sign in to comment.