summaryrefslogtreecommitdiff
path: root/progress.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2012-11-30 17:41:50 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-12-02 02:07:08 -0800
commit1250857c6c2695020bce6669a4ff43d57a507d91 (patch)
tree35e0444e367f30239f161d78c4d483f8ae568991 /progress.c
parentrun-command: do not warn about child death from terminal (diff)
downloadtgif-1250857c6c2695020bce6669a4ff43d57a507d91.tar.xz
launch_editor: propagate signals from editor to git
We block SIGINT and SIGQUIT while the editor runs so that git is not killed accidentally by a stray "^C" meant for the editor or its subprocesses. This works because most editors ignore SIGINT. However, some editor wrappers, like emacsclient, expect to die due to ^C. We detect the signal death in the editor and properly exit, but not before writing a useless error message to stderr. Instead, let's notice when the editor was killed by a terminal signal and just raise the signal on ourselves. This skips the message and looks to our parent like we received SIGINT ourselves. The end effect is that if the user's editor ignores SIGINT, we will, too. And if it does not, then we will behave as if we did not ignore it. That should make all users happy. Note that in the off chance that another part of git has ignored SIGINT while calling launch_editor, we will still properly detect and propagate the failed return code from the editor (i.e., the worst case is that we generate the useless error, not fail to notice the editor's death). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'progress.c')
0 files changed, 0 insertions, 0 deletions