From: Alexandre Courbot <gnurou@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Alexandre Courbot <gnurou@gmail.com>
Subject: [PATCH] send-email: ignore files ending with ~
Date: Sun, 3 Feb 2013 23:55:40 +0900 [thread overview]
Message-ID: <1359903340-14508-1-git-send-email-gnurou@gmail.com> (raw)
It certainly happened to a lot of people already: you carefully prepare
your set of patches, export them using format-patch --cover-letter,
write your cover letter, and send the set like this:
$ git send-email --to=somerenowneddeveloper --to=myfutureemployer
--cc=thismailinglistiwanttoimpress 00*
And of course since you think you know what you are doing, you just
answer 'a' at the first prompt to send all emails at once.
The next day, all these people are laughing at you because the editor
you used to write your cover letter saved a backup of the previous
version and they received two versions of it, including one containing
the familiar *** BLURB HERE *** (or potentially more humiliating stuff
if you used the buffer as a temporary scratch).
Let's save people's reputations by ignoring files ending with '~' in
send-email. There should be no reason to send such a file anyways.
Signed-off-by: Alexandre Courbot <gnurou@gmail.com>
---
git-send-email.perl | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index be809e5..4cc5855 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -548,7 +548,10 @@ while (defined(my $f = shift @ARGV)) {
sort readdir $dh;
closedir $dh;
} elsif ((-f $f or -p $f) and !check_file_rev_conflict($f)) {
- push @files, $f;
+ # Ignore backup files
+ if ($f !~ "~\$") {
+ push @files, $f;
+ }
} else {
push @rev_list_opts, $f;
}
--
1.8.1.1
next reply other threads:[~2013-02-03 14:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-03 14:55 Alexandre Courbot [this message]
2013-02-03 17:16 ` [PATCH] send-email: ignore files ending with ~ Antoine Pelisse
2013-02-04 2:43 ` Alexandre Courbot
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=1359903340-14508-1-git-send-email-gnurou@gmail.com \
--to=gnurou@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).