A single signal handler is used for both SIGTERM
and SIGINT in order to clean up after an uncouth
termination of git-send-email.
In particular, the handler resets the text color
(this cleanup was already present), turns on tty
echoing (in case termination occurrs during a
masked Password prompt), and informs the user of
of any temporary files created by --compose.
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
Perlers, please comment.
git-send-email.perl | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index ed0a473..a0c9e8f 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -24,8 +24,6 @@ use Data::Dumper;
use Term::ANSIColor;
use Git;
-$SIG{INT} = sub { print color("reset"), "\n"; exit };
-
package FakeTerm;
sub new {
my ($class, $reason) = @_;
@@ -201,6 +199,29 @@ my %config_settings = (
"aliasesfile" => \@alias_files,
);
+# Handle Uncouth Termination
+sub signal_handler{
+
+ # Make text normal
+ print color("reset"), "\n";
+
+ # SMTP password masked
+ system "stty echo";
+
+ # tmp files from --compose
+ if (-e $compose_filename) {
+ print "'$compose_filename' contains an intermediate version of the email you were composing.\n";
+ }
+ if (-e ($compose_filename . ".final")) {
+ print "'$compose_filename.final' contains the composed email.\n"
+ }
+
+ exit;
+};
+
+$SIG{TERM} = \&signal_handler;
+$SIG{INT} = \&signal_handler;
+
# Begin by accumulating all the variables (defined above), that we will end up
# needing, first, from the command line:
--
1.5.4.rc5.17.g8ca921-dirty
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html| Peter Zijlstra | [RFC][PATCH 7/7] lockdep: spin_lock_nest_lock() |
| Gabriel C | Re: 2.6.24-rc2-mm1 |
| Andrew Morton | Re: [PATCH 2.6.21] cramfs: add cramfs Linear XIP |
| Jiri Kosina | Re: 2.6.21-rc5-mm4 |
git: | |
| Gregory Haskins | [RFC PATCH 00/17] virtual-bus |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
