summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5a7b1b5)
raw | patch | inline | side by side (parent: 5a7b1b5)
author | Jeff King <peff@peff.net> | |
Fri, 18 Jan 2008 14:19:36 +0000 (09:19 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 18 Jan 2008 21:29:32 +0000 (13:29 -0800) |
We never even look at the command line arguments until after
we have prompted the user for some information. So running
"git send-email" without arguments would prompt for "from"
and "to" headers, only to then die with "No patch files
specified." Instead, let's try to do as much error checking
as possible before getting user input.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
we have prompted the user for some information. So running
"git send-email" without arguments would prompt for "from"
and "to" headers, only to then die with "No patch files
specified." Instead, let's try to do as much error checking
as possible before getting user input.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl | patch | blob | history |
diff --git a/git-send-email.perl b/git-send-email.perl
index e47994afc4d6a1dd92c84706dea1b77c1b832114..7a86977ef104da807743c879532ca942dd2c939a 100755 (executable)
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -314,6 +314,33 @@ if (@alias_files and $aliasfiletype and defined $parse_alias{$aliasfiletype}) {
($sender) = expand_aliases($sender) if defined $sender;
+# Now that all the defaults are set, process the rest of the command line
+# arguments and collect up the files that need to be processed.
+for my $f (@ARGV) {
+ if (-d $f) {
+ opendir(DH,$f)
+ or die "Failed to opendir $f: $!";
+
+ push @files, grep { -f $_ } map { +$f . "/" . $_ }
+ sort readdir(DH);
+
+ } elsif (-f $f) {
+ push @files, $f;
+
+ } else {
+ print STDERR "Skipping $f - not found.\n";
+ }
+}
+
+if (@files) {
+ unless ($quiet) {
+ print $_,"\n" for (@files);
+ }
+} else {
+ print STDERR "\nNo patch files specified!\n\n";
+ usage();
+}
+
my $prompting = 0;
if (!defined $sender) {
$sender = $repoauthor || $repocommitter;
@files = ($compose_filename . ".final");
}
-
-# Now that all the defaults are set, process the rest of the command line
-# arguments and collect up the files that need to be processed.
-for my $f (@ARGV) {
- if (-d $f) {
- opendir(DH,$f)
- or die "Failed to opendir $f: $!";
-
- push @files, grep { -f $_ } map { +$f . "/" . $_ }
- sort readdir(DH);
-
- } elsif (-f $f) {
- push @files, $f;
-
- } else {
- print STDERR "Skipping $f - not found.\n";
- }
-}
-
-if (@files) {
- unless ($quiet) {
- print $_,"\n" for (@files);
- }
-} else {
- print STDERR "\nNo patch files specified!\n\n";
- usage();
-}
-
# Variables we set as part of the loop over files
our ($message_id, %mail, $subject, $reply_to, $references, $message);