git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sean <seanlkml@sympatico.ca>
To: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: git@vger.kernel.org, zsh-workers@sunsite.dk
Subject: Re: git cherry unkillable
Date: Sun, 22 Jan 2006 10:32:04 -0500	[thread overview]
Message-ID: <BAYC1-PASMTP03EC255443CA14D57D82F6AE110@CEZ.ICE> (raw)
Message-ID: <20060122103204.05a16683.seanlkml@sympatico.ca> (raw)
In-Reply-To: <200601221821.54461.arvidjaar@mail.ru>

On Sun, 22 Jan 2006 18:21:53 +0300
Andrey Borzenkov <arvidjaar@mail.ru> wrote:

> this patch fails on zsh; trap 0 never executed after signal (SIGINT to be 
> sure) is caught:
> 
> #!/bin/zsh
> 
> trap "exit 0" 1 2 3 15
> trap "echo  exiting" 0
> 
> sleep 100000000
> 
> {pts/0}% /tmp/timout.zsh ^C
> {pts/0}% 
> 

Damn, would be so much nicer to get this stuff out of shell scripts.   Anyway,
your discovery kills the idea of being able to just ignore the higher signal
traps...   The following implements the same idea as my second patch
in hopefully a slightly more cross-shell compatible way;  it works on bash
and zsh at least.

diff --git a/git-cherry.sh b/git-cherry.sh
index 1a62320..686210b 100755
--- a/git-cherry.sh
+++ b/git-cherry.sh
@@ -49,7 +49,8 @@ ours=`git-rev-list $ours ^$limit` || exi
 tmp=.cherry-tmp$$
 patch=$tmp-patch
 mkdir $patch
-trap "rm -rf $tmp-*" 0 1 2 3 15
+trap "rm -rf $tmp-*" 0
+trap "kill -0 $$" 1 2 3 15
 
 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
diff --git a/git-format-patch.sh b/git-format-patch.sh
index 7e67c4e..9f93bbb 100755
--- a/git-format-patch.sh
+++ b/git-format-patch.sh
@@ -77,7 +77,8 @@ tt)
 esac
 
 tmp=.tmp-series$$
-trap 'rm -f $tmp-*' 0 1 2 3 15
+trap "rm -f $tmp-*" 0
+trap "kill -0 $$" 1 2 3 15
 
 series=$tmp-series
 commsg=$tmp-commsg
diff --git a/git-ls-remote.sh b/git-ls-remote.sh
index f699268..0cd1f07 100755
--- a/git-ls-remote.sh
+++ b/git-ls-remote.sh
@@ -38,7 +38,8 @@ peek_repo="$(get_remote_url "$@")"
 shift
 
 tmp=.ls-remote-$$
-trap "rm -fr $tmp-*" 0 1 2 3 15
+trap "rm -rf $tmp-*" 0
+trap "kill -0 $$" 1 2 3 15
 tmpdir=$tmp-d
 
 case "$peek_repo" in
diff --git a/git-reset.sh b/git-reset.sh
index 6c9e58a..597b36e 100755
--- a/git-reset.sh
+++ b/git-reset.sh
@@ -4,7 +4,8 @@ USAGE='[--mixed | --soft | --hard]  [<co
 . git-sh-setup
 
 tmp=${GIT_DIR}/reset.$$
-trap 'rm -f $tmp-*' 0 1 2 3 15
+trap "rm -f $tmp-*" 0
+trap "kill -0 $$" 1 2 3 15
 
 reset_type=--mixed
 case "$1" in

  reply	other threads:[~2006-01-22 15:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-22 10:23 git cherry unkillable Andrey Borzenkov
     [not found] ` <20060122063904.2dbefbe4.seanlkml@sympatico.ca>
2006-01-22 11:39   ` sean
     [not found]     ` <20060122095113.0eea7aa0.seanlkml@sympatico.ca>
2006-01-22 14:51       ` sean
2006-01-22 15:21         ` Andrey Borzenkov
     [not found]           ` <20060122103204.05a16683.seanlkml@sympatico.ca>
2006-01-22 15:32             ` sean [this message]
     [not found]               ` <20060122104850.33d07ad5.seanlkml@sympatico.ca>
2006-01-22 15:48                 ` sean
2006-01-22 15:01     ` Andrey Borzenkov

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=BAYC1-PASMTP03EC255443CA14D57D82F6AE110@CEZ.ICE \
    --to=seanlkml@sympatico.ca \
    --cc=arvidjaar@mail.ru \
    --cc=git@vger.kernel.org \
    --cc=zsh-workers@sunsite.dk \
    /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).