From: Jonathan Nieder <jrnieder@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
Thomas Rast <trast@student.ethz.ch>, Jehan Bing <jehan@orb.com>,
git@vger.kernel.org
Subject: SIGPIPE handling (Re: [PATCH v3 0/3])
Date: Sat, 18 Feb 2012 04:06:07 -0600 [thread overview]
Message-ID: <20120218100517.GA8998@burratino> (raw)
In-Reply-To: <20120218085221.GA13922@sigill.intra.peff.net>
Hi,
Jeff King wrote:
> Less robust than that is to just ignore SIGPIPE in most git programs
> (which don't benefit from it, and where it is only a liability), but
> then manually enable it for the few that care
This seems backwards. Aren't the only places where it is just a
liability places where git is writing to a pipe that git has created?
We could keep the benefits of SIGPIPE (including simpler error
handling and lack of distracting EPIPE message) in most code, and only
switch to SIGPIPE-ignored semantics where the signal has a chance to
cause harm. Maybe run_command should automatically ignore SIGPIPE
when creating a pipe for the launched command's standard input (with a
flag to ask not to), as a rough heuristic.
There's a subtlety I'm glossing over here, which is that for commands
that produce a lot of output (think: "git fetch --all"), output may
still not the primary goal. I think even they should not block
SIGPIPE, to follow the principle of least surprise in the following
interaction:
git fetch --all 2>&1 | less
... one page later, get bored ...
q (to quit)
Most Unix programs would be killed by SIGPIPE after such a sequence,
so I would expect git to be, too.
Just my two cents,
Jonathan
next prev parent reply other threads:[~2012-02-18 10:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 21:41 [PATCH v2 0/3] Adding a performance framework Thomas Rast
2012-02-16 21:41 ` [PATCH v2 1/3] Move the user-facing test library to test-lib-functions.sh Thomas Rast
2012-02-16 22:14 ` Junio C Hamano
2012-02-17 9:00 ` Thomas Rast
2012-02-17 10:25 ` [PATCH v3 0/3] Thomas Rast
2012-02-17 10:25 ` [PATCH v3 1/3] Move the user-facing test library to test-lib-functions.sh Thomas Rast
2012-02-17 10:25 ` [PATCH v3 2/3] Introduce a performance testing framework Thomas Rast
2012-02-17 10:25 ` [PATCH v3 3/3] Add a performance test for git-grep Thomas Rast
2012-02-17 17:03 ` [PATCH v3 0/3] Junio C Hamano
2012-02-17 23:28 ` Junio C Hamano
2012-02-18 0:51 ` Jeff King
2012-02-18 7:27 ` Junio C Hamano
2012-02-18 8:52 ` Jeff King
2012-02-18 10:06 ` Jonathan Nieder [this message]
2012-02-18 10:10 ` SIGPIPE handling (Re: [PATCH v3 0/3]) Jonathan Nieder
2012-02-18 10:24 ` Jeff King
2012-02-16 21:41 ` [PATCH v2 2/3] Introduce a performance testing framework Thomas Rast
2012-02-17 7:45 ` Jeff King
2012-02-16 21:41 ` [PATCH v2 3/3] Add a performance test for git-grep Thomas Rast
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120218100517.GA8998@burratino \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jehan@orb.com \
--cc=peff@peff.net \
--cc=trast@student.ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).