git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Joe Perches <joe@perches.com>
Date
Jul 22, 2011, 07:29 UTC
Message-ID
<865ddd502d9ba4a19c33c69039ecb70ea12c0692.1311319658.git.joe@perches.com>
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(-)
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
Next: Joe Perches
Message 1 of 3 in “git-send-email: Do not send editor backup files in a directory”
  1. git-send-email: Do not send editor backup files in a directoryJoe Perches, Jul 22, 2011
  2. Joe PerchesJul 29, 2011
  3. Ramkumar RamachandraJul 29, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.