git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] send-email: ignore files ending with ~
@ 2013-02-03 14:55 Alexandre Courbot
  2013-02-03 17:16 ` Antoine Pelisse
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Courbot @ 2013-02-03 14:55 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Alexandre Courbot

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] send-email: ignore files ending with ~
  2013-02-03 14:55 [PATCH] send-email: ignore files ending with ~ Alexandre Courbot
@ 2013-02-03 17:16 ` Antoine Pelisse
  2013-02-04  2:43   ` Alexandre Courbot
  0 siblings, 1 reply; 3+ messages in thread
From: Antoine Pelisse @ 2013-02-03 17:16 UTC (permalink / raw)
  To: Alexandre Courbot; +Cc: Junio C Hamano, git

On Sun, Feb 3, 2013 at 3:55 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
> 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*

Why don't you use 00*.patch ? That seems dubious to me to ignore files
specified on the command line.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] send-email: ignore files ending with ~
  2013-02-03 17:16 ` Antoine Pelisse
@ 2013-02-04  2:43   ` Alexandre Courbot
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Courbot @ 2013-02-04  2:43 UTC (permalink / raw)
  To: Antoine Pelisse; +Cc: Junio C Hamano, git

On Mon, Feb 4, 2013 at 2:16 AM, Antoine Pelisse <apelisse@gmail.com> wrote:
> On Sun, Feb 3, 2013 at 3:55 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
>> 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*
>
> Why don't you use 00*.patch ? That seems dubious to me to ignore files
> specified on the command line.

For the same reason I do not list all the patches individually on the
command line: laziness.

The goal of this patch is in no way to argue that using send-email
like this is a recommandable way. It just adds a safeguard on a
use-case that is probably not so uncommon.

Alex.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-04  2:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-03 14:55 [PATCH] send-email: ignore files ending with ~ Alexandre Courbot
2013-02-03 17:16 ` Antoine Pelisse
2013-02-04  2:43   ` Alexandre Courbot

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).