Skip to content

Commit 2718435

Browse files
pugmajereJunio C Hamano
authored andcommitted
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>
1 parent df9892f commit 2718435

File tree

2 files changed

+37
-26
lines changed

2 files changed

+37
-26
lines changed

Documentation/git-send-email.txt

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,44 +24,48 @@ OPTIONS
2424
-------
2525
The options available are:
2626

27-
--to::
28-
Specify the primary recipient of the emails generated.
29-
Generally, this will be the upstream maintainer of the
30-
project involved.
27+
--chain-reply-to, --no-chain-reply-to::
28+
If this is set, each email will be sent as a reply to the previous
29+
email sent. If disabled with "--no-chain-reply-to", all emails after
30+
the first will be sent as replies to the first email sent. When using
31+
this, it is recommended that the first file given be an overview of the
32+
entire patch series.
33+
Default is --chain-reply-to
34+
35+
--compose::
36+
Use $EDITOR to edit an introductory message for the
37+
patch series.
3138

3239
--from::
3340
Specify the sender of the emails. This will default to
3441
the value GIT_COMMITTER_IDENT, as returned by "git-var -l".
3542
The user will still be prompted to confirm this entry.
3643

37-
--compose::
38-
Use \$EDITOR to edit an introductory message for the
39-
patch series.
40-
41-
--subject::
42-
Specify the initial subject of the email thread.
43-
Only necessary if --compose is also set. If --compose
44-
is not set, this will be prompted for.
45-
4644
--in-reply-to::
4745
Specify the contents of the first In-Reply-To header.
4846
Subsequent emails will refer to the previous email
4947
instead of this if --chain-reply-to is set (the default)
5048
Only necessary if --compose is also set. If --compose
5149
is not set, this will be prompted for.
5250

53-
--chain-reply-to, --no-chain-reply-to::
54-
If this is set, each email will be sent as a reply to the previous
55-
email sent. If disabled with "--no-chain-reply-to", all emails after
56-
the first will be sent as replies to the first email sent. When using
57-
this, it is recommended that the first file given be an overview of the
58-
entire patch series.
59-
Default is --chain-reply-to
51+
--quiet::
52+
Make git-send-email less verbose. One line per email should be
53+
all that is output.
6054

6155
--smtp-server::
6256
If set, specifies the outgoing SMTP server to use. Defaults to
6357
localhost.
6458

59+
--subject::
60+
Specify the initial subject of the email thread.
61+
Only necessary if --compose is also set. If --compose
62+
is not set, this will be prompted for.
63+
64+
--to::
65+
Specify the primary recipient of the emails generated.
66+
Generally, this will be the upstream maintainer of the
67+
project involved.
68+
6569

6670
Author
6771
------

git-send-email.perl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@
186186
}
187187

188188
if (@files) {
189-
print $_,"\n" for @files;
189+
unless ($quiet) {
190+
print $_,"\n" for (@files);
191+
}
190192
} else {
191193
print <<EOT;
192194
git-send-email [options] <file | directory> [... file | directory ]
@@ -213,6 +215,10 @@
213215
--smtp-server If set, specifies the outgoing SMTP server to use.
214216
Defaults to localhost.
215217
218+
--quiet Make git-send-email less verbose. One line per email should be
219+
all that is output.
220+
221+
216222
Error: Please specify a file or a directory on the command line.
217223
EOT
218224
exit(1);
@@ -268,7 +274,9 @@ sub send_message
268274

269275
sendmail(%mail) or die $Mail::Sendmail::error;
270276

271-
unless ($quiet) {
277+
if ($quiet) {
278+
printf "Sent %s\n", $subject;
279+
} else {
272280
print "OK. Log says:\n", $Mail::Sendmail::log;
273281
print "\n\n"
274282
}
@@ -280,7 +288,6 @@ sub send_message
280288
$subject = $initial_subject;
281289

282290
foreach my $t (@files) {
283-
my $F = $t;
284291
open(F,"<",$t) or die "can't open file $t";
285292

286293
@cc = ();
@@ -298,7 +305,7 @@ sub send_message
298305

299306
} elsif (/^(Cc|From):\s+(.*)$/) {
300307
printf("(mbox) Adding cc: %s from line '%s'\n",
301-
$2, $_);
308+
$2, $_) unless $quiet;
302309
push @cc, $2;
303310
}
304311

@@ -310,7 +317,7 @@ sub send_message
310317
# So let's support that, too.
311318
if (@cc == 0) {
312319
printf("(non-mbox) Adding cc: %s from line '%s'\n",
313-
$_, $_);
320+
$_, $_) unless $quiet;
314321

315322
push @cc, $_;
316323

@@ -330,7 +337,7 @@ sub send_message
330337
chomp $c;
331338
push @cc, $c;
332339
printf("(sob) Adding cc: %s from line '%s'\n",
333-
$c, $_);
340+
$c, $_) unless $quiet;
334341
}
335342
}
336343
}

0 commit comments

Comments
 (0)