diff-highlight: exit when a pipe is broken
commit251e7dad517bd369387c4dedfe77b380f025e0f3
authorJohn Szakmeister <john@szakmeister.net>
Tue, 4 Nov 2014 20:01:12 +0000 (4 15:01 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Nov 2014 21:18:35 +0000 (4 13:18 -0800)
treeb7ba495d93e721ac136eac5a5f421b7460e2981c
parenteeff891ac756fd97a05476446f15269b714ce4cc
diff-highlight: exit when a pipe is broken

While using diff-highlight with other tools, I have discovered that Python
ignores SIGPIPE by default.  Unfortunately, this also means that tools
attempting to launch a pager under Python--and don't realize this is
happening--means that the subprocess inherits this setting.  In this case, it
means diff-highlight will be launched with SIGPIPE being ignored.  Let's work
with those broken scripts by restoring the default SIGPIPE handler.

Signed-off-by: John Szakmeister <john@szakmeister.net>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/diff-highlight/diff-highlight