threads / patch / 27884

patchgit-send-email: Do not send editor backup files in a directory

Subject: [PATCH] git-send-email: Do not send editor backup files in a directory

## tl;dr

3 messages between Jul 22, 2011 and Jul 29, 2011. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Joe Perches· Jul 22, 2011, 07:29 UTC · lore
Sift out backup files that are commonly created by editors.
Signed-off-by: Joe Perches <joe@perches.com>
---
 git-send-email.perl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Show changes to git-send-email.perl +3 −1
diff --git a/git-send-email.perl b/git-send-email.perl
index 98ab33a..a4558d9 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -521,7 +521,9 @@ while (defined(my $f = shift @ARGV)) {
 		opendir my $dh, $f
 			or die "Failed to opendir $f: $!";
 
-		push @files, grep { -f $_ } map { catfile($f, $_) }
+		push @files, grep { !/#.+#$/ && !/~$/ &&
+					!/\.bak$/ && !/\.orig$/ &&
+					-f $_ } map { catfile($f, $_) }
 				sort readdir $dh;
 		closedir $dh;
 	} elsif ((-f $f or -p $f) and !check_file_rev_conflict($f)) {
-- 
1.7.6.131.g99019
Joe Perches· Jul 29, 2011, 00:41 UTC · re: Joe Perches · lore

Re: [PATCH] git-send-email: Do not send editor backup files in a directory

Joe Perches <joe <at> perches.com> writes:
> Sift out backup files that are commonly created by editors.
Ping?
-------------- 
Show changes to git-send-email.perl +3 −1
diff --git a/git-send-email.perl b/git-send-email.perl
[]
@@ -521,7 +521,9 @@ while (defined(my $f = shift @ARGV)) {
[]
-		push @files, grep { -f $_ } map { catfile($f, $_) }
+		push @files, grep { !/#.+#$/ && !/~$/ &&
+					!/\.bak$/ && !/\.orig$/ &&
+					-f $_ } map { catfile($f, $_) }
Ramkumar Ramachandra· Jul 29, 2011, 06:47 UTC · re: Joe Perches · lore

Re: [PATCH] git-send-email: Do not send editor backup files in a directory

Hi Joe,
Joe Perches writes
> [Subject: git-send-email: Do not send editor backup files in a directory]

I like this change. I don't have to resort to my normal `git send-email outgoing/*.patch` anymore.

Thanks.
-- Ram

← back to recent threads