From: Pierre Habouzit Date: Fri, 31 Oct 2008 10:57:11 GMT Subject: [PATCH 2/3] git send-email: interpret unknown files as revision lists Message-ID: <1225450632-7230-3-git-send-email-madcoder@debian.org> In-Reply-To: <1225450632-7230-2-git-send-email-madcoder@debian.org> Instead of skipping unkown files on the command line, pass them through git format-patch into a safe temporary directory. This allow no complicated rev-list option lists combining "--all" "--not" and so on, but allow to use ranges which are quite enough for most of the use cases. Signed-off-by: Pierre Habouzit --- Documentation/git-send-email.txt | 2 +- git-send-email.perl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index 82f5056..cafff1a 100644 --- a/Documentation/git-send-email.txt +++ b/Documentation/git-send-email.txt @@ -8,7 +8,7 @@ git-send-email - Send a collection of patches as emails SYNOPSIS -------- -'git send-email' [options] [... file|directory] +'git send-email' [options] ... DESCRIPTION diff --git a/git-send-email.perl b/git-send-email.perl index 94ca5c8..0d50ee2 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -22,6 +22,7 @@ use Term::ReadLine; use Getopt::Long; use Data::Dumper; use Term::ANSIColor; +use File::Temp qw/ tempdir /; use Git; package FakeTerm; @@ -38,7 +39,7 @@ package main; sub usage { print <... +git send-email [options] Composing: --from * Email From: @@ -378,7 +379,8 @@ for my $f (@ARGV) { } elsif (-f $f or -p $f) { push @files, $f; } else { - print STDERR "Skipping $f - not found.\n"; + my $tempdir = tempdir(CLEANUP => 1); + push @files, $repo->command('format-patch', '-o', $tempdir, $f); } } -- 1.6.0.3.759.g40a2.dirty