{"thread":{"id":"3246","subject":"[PATCH] git-send-email: Fully implement --quiet and document it.","startedAt":"2006-02-06T01:13:52Z","lastAt":"2006-02-06T01:13:52Z","messageCount":1,"participants":["Ryan Anderson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"15626","messageId":"1139188432972-git-send-email-ryan@michonline.com","threadId":"3246","inReplyTo":null,"subject":"[PATCH] git-send-email: Fully implement --quiet and document it.","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2006-02-06T01:13:52Z","receivedAt":"2006-02-06T01:13:52Z","isPatch":true,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"Also reorganizes the man page to list options alphabetically.\n\nSigned-off-by: Ryan Anderson <ryan@michonline.com>\n\n---\n\n Documentation/git-send-email.txt |   44 +++++++++++++++++++++-----------------\n git-send-email.perl              |   19 +++++++++++-----\n 2 files changed, 37 insertions(+), 26 deletions(-)\n\n3b91b8b4e04e5cf42b7e5bd22b1bdda9c50ed781\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex b9bec55..00537d8 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -24,25 +24,23 @@ OPTIONS\n -------\n The options available are:\n \n---to::\n-\tSpecify the primary recipient of the emails generated.\n-\tGenerally, this will be the upstream maintainer of the\n-\tproject involved.\n+--chain-reply-to, --no-chain-reply-to::\n+\tIf this is set, each email will be sent as a reply to the previous\n+\temail sent.  If disabled with \"--no-chain-reply-to\", all emails after\n+\tthe first will be sent as replies to the first email sent.  When using\n+\tthis, it is recommended that the first file given be an overview of the\n+\tentire patch series.\n+\tDefault is --chain-reply-to\n+\n+--compose::\n+\tUse $EDITOR to edit an introductory message for the\n+\tpatch series.\n \n --from::\n \tSpecify the sender of the emails.  This will default to\n \tthe value GIT_COMMITTER_IDENT, as returned by \"git-var -l\".\n \tThe user will still be prompted to confirm this entry.\n \n---compose::\n-\tUse \\$EDITOR to edit an introductory message for the\n-\tpatch series.\n-\n---subject::\n-   \tSpecify the initial subject of the email thread.\n-\tOnly necessary if --compose is also set.  If --compose\n-\tis not set, this will be prompted for.\n-\n --in-reply-to::\n \tSpecify the contents of the first In-Reply-To header.\n \tSubsequent emails will refer to the previous email \n@@ -50,18 +48,24 @@ The options available are:\n \tOnly necessary if --compose is also set.  If --compose\n \tis not set, this will be prompted for.\n \n---chain-reply-to, --no-chain-reply-to::\n-\tIf this is set, each email will be sent as a reply to the previous\n-\temail sent.  If disabled with \"--no-chain-reply-to\", all emails after\n-\tthe first will be sent as replies to the first email sent.  When using\n-\tthis, it is recommended that the first file given be an overview of the\n-\tentire patch series.\n-\tDefault is --chain-reply-to\n+--quiet::\n+\tMake git-send-email less verbose.  One line per email should be\n+\tall that is output.\n \n --smtp-server::\n \tIf set, specifies the outgoing SMTP server to use.  Defaults to\n \tlocalhost.\n \n+--subject::\n+   \tSpecify the initial subject of the email thread.\n+\tOnly necessary if --compose is also set.  If --compose\n+\tis not set, this will be prompted for.\n+\n+--to::\n+\tSpecify the primary recipient of the emails generated.\n+\tGenerally, this will be the upstream maintainer of the\n+\tproject involved.\n+\n \n Author\n ------\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 2977b9a..3f1b3ca 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -186,7 +186,9 @@ for my $f (@ARGV) {\n }\n \n if (@files) {\n-\tprint $_,\"\\n\" for @files;\n+\tunless ($quiet) {\n+\t\tprint $_,\"\\n\" for (@files);\n+\t}\n } else {\n \tprint <<EOT;\n git-send-email [options] <file | directory> [... file | directory ]\n@@ -213,6 +215,10 @@ Options:\n    --smtp-server  If set, specifies the outgoing SMTP server to use.\n                   Defaults to localhost.\n \n+   --quiet\tMake git-send-email less verbose.  One line per email should be\n+\t\tall that is output.\n+\n+\n Error: Please specify a file or a directory on the command line.\n EOT\n \texit(1);\n@@ -268,7 +274,9 @@ sub send_message\n \n \tsendmail(%mail) or die $Mail::Sendmail::error;\n \n-\tunless ($quiet) {\n+\tif ($quiet) {\n+\t\tprintf \"Sent %s\\n\", $subject;\n+\t} else {\n \t\tprint \"OK. Log says:\\n\", $Mail::Sendmail::log;\n \t\tprint \"\\n\\n\"\n \t}\n@@ -280,7 +288,6 @@ make_message_id();\n $subject = $initial_subject;\n \n foreach my $t (@files) {\n-\tmy $F = $t;\n \topen(F,\"<\",$t) or die \"can't open file $t\";\n \n \t@cc = ();\n@@ -298,7 +305,7 @@ foreach my $t (@files) {\n \n \t\t\t\t} elsif (/^(Cc|From):\\s+(.*)$/) {\n \t\t\t\t\tprintf(\"(mbox) Adding cc: %s from line '%s'\\n\",\n-\t\t\t\t\t\t$2, $_);\n+\t\t\t\t\t\t$2, $_) unless $quiet;\n \t\t\t\t\tpush @cc, $2;\n \t\t\t\t}\n \n@@ -310,7 +317,7 @@ foreach my $t (@files) {\n \t\t\t\t# So let's support that, too.\n \t\t\t\tif (@cc == 0) {\n \t\t\t\t\tprintf(\"(non-mbox) Adding cc: %s from line '%s'\\n\",\n-\t\t\t\t\t\t$_, $_);\n+\t\t\t\t\t\t$_, $_) unless $quiet;\n \n \t\t\t\t\tpush @cc, $_;\n \n@@ -330,7 +337,7 @@ foreach my $t (@files) {\n \t\t\t\tchomp $c;\n \t\t\t\tpush @cc, $c;\n \t\t\t\tprintf(\"(sob) Adding cc: %s from line '%s'\\n\",\n-\t\t\t\t\t$c, $_);\n+\t\t\t\t\t$c, $_) unless $quiet;\n \t\t\t}\n \t\t}\n \t}\n-- \n1.1.6.ga5ec-dirty\n"}]}