{"thread":{"id":"32818","subject":"[PATCH] send-email: ignore files ending with ~","startedAt":"2013-02-03T14:55:40Z","lastAt":"2013-02-04T02:43:51Z","messageCount":3,"participants":["Alexandre Courbot","Antoine Pelisse"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"208547","messageId":"1359903340-14508-1-git-send-email-gnurou@gmail.com","threadId":"32818","inReplyTo":null,"subject":"[PATCH] send-email: ignore files ending with ~","fromName":"Alexandre Courbot","fromEmail":"gnurou@gmail.com","sentAt":"2013-02-03T14:55:40Z","receivedAt":"2013-02-03T14:55:40Z","isPatch":true,"sender":{"key":"gnurou@gmail.com","avatar":null},"body":"It certainly happened to a lot of people already: you carefully prepare\nyour set of patches, export them using format-patch --cover-letter,\nwrite your cover letter, and send the set like this:\n\n$ git send-email --to=somerenowneddeveloper --to=myfutureemployer\n  --cc=thismailinglistiwanttoimpress 00*\n\nAnd of course since you think you know what you are doing, you just\nanswer 'a' at the first prompt to send all emails at once.\n\nThe next day, all these people are laughing at you because the editor\nyou used to write your cover letter saved a backup of the previous\nversion and they received two versions of it, including one containing\nthe familiar *** BLURB HERE *** (or potentially more humiliating stuff\nif you used the buffer as a temporary scratch).\n\nLet's save people's reputations by ignoring files ending with '~' in\nsend-email. There should be no reason to send such a file anyways.\n\nSigned-off-by: Alexandre Courbot <gnurou@gmail.com>\n---\n git-send-email.perl | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex be809e5..4cc5855 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -548,7 +548,10 @@ while (defined(my $f = shift @ARGV)) {\n \t\t\t\tsort readdir $dh;\n \t\tclosedir $dh;\n \t} elsif ((-f $f or -p $f) and !check_file_rev_conflict($f)) {\n-\t\tpush @files, $f;\n+\t\t# Ignore backup files\n+\t\tif ($f !~ \"~\\$\") {\n+\t\t\tpush @files, $f;\n+\t\t}\n \t} else {\n \t\tpush @rev_list_opts, $f;\n \t}\n-- \n1.8.1.1\n"},{"id":"208551","messageId":"CALWbr2wCEHkVU86Dkzq1+mRx605h4LBo-5e8ySAwv=T0pMw62A@mail.gmail.com","threadId":"32818","inReplyTo":"1359903340-14508-1-git-send-email-gnurou@gmail.com","subject":"Re: [PATCH] send-email: ignore files ending with ~","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-02-03T17:16:16Z","receivedAt":"2013-02-03T17:16:16Z","isPatch":true,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"On Sun, Feb 3, 2013 at 3:55 PM, Alexandre Courbot <gnurou@gmail.com> wrote:\n> It certainly happened to a lot of people already: you carefully prepare\n> your set of patches, export them using format-patch --cover-letter,\n> write your cover letter, and send the set like this:\n>\n> $ git send-email --to=somerenowneddeveloper --to=myfutureemployer\n>   --cc=thismailinglistiwanttoimpress 00*\n\nWhy don't you use 00*.patch ? That seems dubious to me to ignore files\nspecified on the command line.\n"},{"id":"208580","messageId":"CAAVeFu+s4UqOxywKSviwkhc88qShfJRdEozfTt2ifpRm+=DwSA@mail.gmail.com","threadId":"32818","inReplyTo":"CALWbr2wCEHkVU86Dkzq1+mRx605h4LBo-5e8ySAwv=T0pMw62A@mail.gmail.com","subject":"Re: [PATCH] send-email: ignore files ending with ~","fromName":"Alexandre Courbot","fromEmail":"gnurou@gmail.com","sentAt":"2013-02-04T02:43:51Z","receivedAt":"2013-02-04T02:43:51Z","isPatch":true,"sender":{"key":"gnurou@gmail.com","avatar":null},"body":"On Mon, Feb 4, 2013 at 2:16 AM, Antoine Pelisse <apelisse@gmail.com> wrote:\n> On Sun, Feb 3, 2013 at 3:55 PM, Alexandre Courbot <gnurou@gmail.com> wrote:\n>> It certainly happened to a lot of people already: you carefully prepare\n>> your set of patches, export them using format-patch --cover-letter,\n>> write your cover letter, and send the set like this:\n>>\n>> $ git send-email --to=somerenowneddeveloper --to=myfutureemployer\n>>   --cc=thismailinglistiwanttoimpress 00*\n>\n> Why don't you use 00*.patch ? That seems dubious to me to ignore files\n> specified on the command line.\n\nFor the same reason I do not list all the patches individually on the\ncommand line: laziness.\n\nThe goal of this patch is in no way to argue that using send-email\nlike this is a recommandable way. It just adds a safeguard on a\nuse-case that is probably not so uncommon.\n\nAlex.\n"}]}