git-send-email: Fully implement --quiet and document it.
Also reorganizes the man page to list options alphabetically. Signed-off-by: Ryan Anderson <ryan@michonline.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
df9892ffce
commit
2718435b7b
@ -24,32 +24,6 @@ OPTIONS
|
|||||||
-------
|
-------
|
||||||
The options available are:
|
The options available are:
|
||||||
|
|
||||||
--to::
|
|
||||||
Specify the primary recipient of the emails generated.
|
|
||||||
Generally, this will be the upstream maintainer of the
|
|
||||||
project involved.
|
|
||||||
|
|
||||||
--from::
|
|
||||||
Specify the sender of the emails. This will default to
|
|
||||||
the value GIT_COMMITTER_IDENT, as returned by "git-var -l".
|
|
||||||
The user will still be prompted to confirm this entry.
|
|
||||||
|
|
||||||
--compose::
|
|
||||||
Use \$EDITOR to edit an introductory message for the
|
|
||||||
patch series.
|
|
||||||
|
|
||||||
--subject::
|
|
||||||
Specify the initial subject of the email thread.
|
|
||||||
Only necessary if --compose is also set. If --compose
|
|
||||||
is not set, this will be prompted for.
|
|
||||||
|
|
||||||
--in-reply-to::
|
|
||||||
Specify the contents of the first In-Reply-To header.
|
|
||||||
Subsequent emails will refer to the previous email
|
|
||||||
instead of this if --chain-reply-to is set (the default)
|
|
||||||
Only necessary if --compose is also set. If --compose
|
|
||||||
is not set, this will be prompted for.
|
|
||||||
|
|
||||||
--chain-reply-to, --no-chain-reply-to::
|
--chain-reply-to, --no-chain-reply-to::
|
||||||
If this is set, each email will be sent as a reply to the previous
|
If this is set, each email will be sent as a reply to the previous
|
||||||
email sent. If disabled with "--no-chain-reply-to", all emails after
|
email sent. If disabled with "--no-chain-reply-to", all emails after
|
||||||
@ -58,10 +32,40 @@ The options available are:
|
|||||||
entire patch series.
|
entire patch series.
|
||||||
Default is --chain-reply-to
|
Default is --chain-reply-to
|
||||||
|
|
||||||
|
--compose::
|
||||||
|
Use $EDITOR to edit an introductory message for the
|
||||||
|
patch series.
|
||||||
|
|
||||||
|
--from::
|
||||||
|
Specify the sender of the emails. This will default to
|
||||||
|
the value GIT_COMMITTER_IDENT, as returned by "git-var -l".
|
||||||
|
The user will still be prompted to confirm this entry.
|
||||||
|
|
||||||
|
--in-reply-to::
|
||||||
|
Specify the contents of the first In-Reply-To header.
|
||||||
|
Subsequent emails will refer to the previous email
|
||||||
|
instead of this if --chain-reply-to is set (the default)
|
||||||
|
Only necessary if --compose is also set. If --compose
|
||||||
|
is not set, this will be prompted for.
|
||||||
|
|
||||||
|
--quiet::
|
||||||
|
Make git-send-email less verbose. One line per email should be
|
||||||
|
all that is output.
|
||||||
|
|
||||||
--smtp-server::
|
--smtp-server::
|
||||||
If set, specifies the outgoing SMTP server to use. Defaults to
|
If set, specifies the outgoing SMTP server to use. Defaults to
|
||||||
localhost.
|
localhost.
|
||||||
|
|
||||||
|
--subject::
|
||||||
|
Specify the initial subject of the email thread.
|
||||||
|
Only necessary if --compose is also set. If --compose
|
||||||
|
is not set, this will be prompted for.
|
||||||
|
|
||||||
|
--to::
|
||||||
|
Specify the primary recipient of the emails generated.
|
||||||
|
Generally, this will be the upstream maintainer of the
|
||||||
|
project involved.
|
||||||
|
|
||||||
|
|
||||||
Author
|
Author
|
||||||
------
|
------
|
||||||
|
@ -186,7 +186,9 @@ for my $f (@ARGV) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (@files) {
|
if (@files) {
|
||||||
print $_,"\n" for @files;
|
unless ($quiet) {
|
||||||
|
print $_,"\n" for (@files);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print <<EOT;
|
print <<EOT;
|
||||||
git-send-email [options] <file | directory> [... file | directory ]
|
git-send-email [options] <file | directory> [... file | directory ]
|
||||||
@ -213,6 +215,10 @@ Options:
|
|||||||
--smtp-server If set, specifies the outgoing SMTP server to use.
|
--smtp-server If set, specifies the outgoing SMTP server to use.
|
||||||
Defaults to localhost.
|
Defaults to localhost.
|
||||||
|
|
||||||
|
--quiet Make git-send-email less verbose. One line per email should be
|
||||||
|
all that is output.
|
||||||
|
|
||||||
|
|
||||||
Error: Please specify a file or a directory on the command line.
|
Error: Please specify a file or a directory on the command line.
|
||||||
EOT
|
EOT
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -268,7 +274,9 @@ sub send_message
|
|||||||
|
|
||||||
sendmail(%mail) or die $Mail::Sendmail::error;
|
sendmail(%mail) or die $Mail::Sendmail::error;
|
||||||
|
|
||||||
unless ($quiet) {
|
if ($quiet) {
|
||||||
|
printf "Sent %s\n", $subject;
|
||||||
|
} else {
|
||||||
print "OK. Log says:\n", $Mail::Sendmail::log;
|
print "OK. Log says:\n", $Mail::Sendmail::log;
|
||||||
print "\n\n"
|
print "\n\n"
|
||||||
}
|
}
|
||||||
@ -280,7 +288,6 @@ make_message_id();
|
|||||||
$subject = $initial_subject;
|
$subject = $initial_subject;
|
||||||
|
|
||||||
foreach my $t (@files) {
|
foreach my $t (@files) {
|
||||||
my $F = $t;
|
|
||||||
open(F,"<",$t) or die "can't open file $t";
|
open(F,"<",$t) or die "can't open file $t";
|
||||||
|
|
||||||
@cc = ();
|
@cc = ();
|
||||||
@ -298,7 +305,7 @@ foreach my $t (@files) {
|
|||||||
|
|
||||||
} elsif (/^(Cc|From):\s+(.*)$/) {
|
} elsif (/^(Cc|From):\s+(.*)$/) {
|
||||||
printf("(mbox) Adding cc: %s from line '%s'\n",
|
printf("(mbox) Adding cc: %s from line '%s'\n",
|
||||||
$2, $_);
|
$2, $_) unless $quiet;
|
||||||
push @cc, $2;
|
push @cc, $2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +317,7 @@ foreach my $t (@files) {
|
|||||||
# So let's support that, too.
|
# So let's support that, too.
|
||||||
if (@cc == 0) {
|
if (@cc == 0) {
|
||||||
printf("(non-mbox) Adding cc: %s from line '%s'\n",
|
printf("(non-mbox) Adding cc: %s from line '%s'\n",
|
||||||
$_, $_);
|
$_, $_) unless $quiet;
|
||||||
|
|
||||||
push @cc, $_;
|
push @cc, $_;
|
||||||
|
|
||||||
@ -330,7 +337,7 @@ foreach my $t (@files) {
|
|||||||
chomp $c;
|
chomp $c;
|
||||||
push @cc, $c;
|
push @cc, $c;
|
||||||
printf("(sob) Adding cc: %s from line '%s'\n",
|
printf("(sob) Adding cc: %s from line '%s'\n",
|
||||||
$c, $_);
|
$c, $_) unless $quiet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user