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>
Ryan Anderson committed
Feb 5, 2006 at 20:13 UTC
2718435b7b746c3c249525b02fbcbad68f5a45f3
2 files changed
+37
-26
Documentation/git-send-email.txt
+24
-20
@@ -24,25 +24,23 @@ OPTIONS
24
-------
25
The options available are:
26
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.
38
39
--from::
40
Specify the sender of the emails. This will default to
41
the value GIT_COMMITTER_IDENT, as returned by "git-var -l".
42
The user will still be prompted to confirm this entry.
43
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
-
44
--in-reply-to::
45
Specify the contents of the first In-Reply-To header.
46
Subsequent emails will refer to the previous email
@@ -50,18 +48,24 @@ The options available are:
48
Only necessary if --compose is also set. If --compose
49
is not set, this will be prompted for.
50
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.
54
55
--smtp-server::
56
If set, specifies the outgoing SMTP server to use. Defaults to
57
localhost.
58
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
+
69
70
Author
71
------
git-send-email.perl
+13
-6
@@ -186,7 +186,9 @@ for my $f (@ARGV) {
186
}
187
188
if (@files) {
189
- print $_,"\n" for @files;
189
+ unless ($quiet) {
190
+ print $_,"\n" for (@files);
191
+ }
192
} else {
193
print <<EOT;
194
git-send-email [options] <file | directory> [... file | directory ]
@@ -213,6 +215,10 @@ Options:
215
--smtp-server If set, specifies the outgoing SMTP server to use.
216
Defaults to localhost.
217
218
+ --quiet Make git-send-email less verbose. One line per email should be
219
+ all that is output.
220
+
221
+
222
Error: Please specify a file or a directory on the command line.
223
EOT
224
exit(1);
@@ -268,7 +274,9 @@ sub send_message
274
275
sendmail(%mail) or die $Mail::Sendmail::error;
276
271
- unless ($quiet) {
277
+ if ($quiet) {
278
+ printf "Sent %s\n", $subject;
279
+ } else {
280
print "OK. Log says:\n", $Mail::Sendmail::log;
281
print "\n\n"
282
}
@@ -280,7 +288,6 @@ make_message_id();
288
$subject = $initial_subject;
289
290
foreach my $t (@files) {
283
- my $F = $t;
291
open(F,"<",$t) or die "can't open file $t";
292
293
@cc = ();
@@ -298,7 +305,7 @@ foreach my $t (@files) {
305
306
} elsif (/^(Cc|From):\s+(.*)$/) {
307
printf("(mbox) Adding cc: %s from line '%s'\n",
301
- $2, $_);
308
+ $2, $_) unless $quiet;
309
push @cc, $2;
310
}
311
@@ -310,7 +317,7 @@ foreach my $t (@files) {
317
# So let's support that, too.
318
if (@cc == 0) {
319
printf("(non-mbox) Adding cc: %s from line '%s'\n",
313
- $_, $_);
320
+ $_, $_) unless $quiet;
321
322
push @cc, $_;
323
@@ -330,7 +337,7 @@ foreach my $t (@files) {
337
chomp $c;
338
push @cc, $c;
339
printf("(sob) Adding cc: %s from line '%s'\n",
333
- $c, $_);
340
+ $c, $_) unless $quiet;
341
}
342
}
343
}