{"thread":{"id":"13274","subject":"[PATCH] git-format-patch: add a new format.cc configuration variable","startedAt":"2008-04-26T21:19:06Z","lastAt":"2008-04-29T17:21:36Z","messageCount":12,"participants":["Miklos Vajna","Johannes Schindelin","Junio C Hamano","Teemu Likonen","Jeff King","Jay Soffian"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"75239","messageId":"1209244746-12649-1-git-send-email-vmiklos@frugalware.org","threadId":"13274","inReplyTo":null,"subject":"[PATCH] git-format-patch: add a new format.cc configuration variable","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-04-26T21:19:06Z","receivedAt":"2008-04-26T21:19:06Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Some projects prefer to always CC patches to a given mailing list. In\nthese cases, it's handy to configure that address once.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n Documentation/git-format-patch.txt |    1 +\n builtin-log.c                      |    7 +++++++\n 2 files changed, 8 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex b5207b7..b2bdcb2 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -168,6 +168,7 @@ and file suffix, and number patches when outputting more than one.\n         subjectprefix = CHANGE\n         suffix = .txt\n         numbered = auto\n+        cc = <email>\n ------------\n \n \ndiff --git a/builtin-log.c b/builtin-log.c\nindex 1670d0b..d7907c9 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -485,6 +485,13 @@ static int git_format_config(const char *var, const char *value)\n \t\tfmt_patch_suffix = xstrdup(value);\n \t\treturn 0;\n \t}\n+\tif (!strcmp(var, \"format.cc\")) {\n+\t\tif (!value)\n+\t\t\treturn config_error_nonbool(var);\n+\t\tALLOC_GROW(extra_cc, extra_cc_nr + 1, extra_cc_alloc);\n+\t\textra_cc[extra_cc_nr++] = xstrdup(value);\n+\t\treturn 0;\n+\t}\n \tif (!strcmp(var, \"diff.color\") || !strcmp(var, \"color.diff\")) {\n \t\treturn 0;\n \t}\n-- \n1.5.5.1.91.g499fc.dirty\n"},{"id":"75240","messageId":"alpine.DEB.1.00.0804262330370.7944@eeepc-johanness","threadId":"13274","inReplyTo":"1209244746-12649-1-git-send-email-vmiklos@frugalware.org","subject":"Re: [PATCH] git-format-patch: add a new format.cc configuration variable","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-04-26T22:31:13Z","receivedAt":"2008-04-26T22:31:13Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 26 Apr 2008, Miklos Vajna wrote:\n\n> Some projects prefer to always CC patches to a given mailing list. In\n> these cases, it's handy to configure that address once.\n\nI am wary... should this not be specific to send-email?  IOW should \nformat-patch not be left alone?\n\nCiao,\nDscho\n"},{"id":"75243","messageId":"20080426232737.GR4012@genesis.frugalware.org","threadId":"13274","inReplyTo":"alpine.DEB.1.00.0804262330370.7944@eeepc-johanness","subject":"Re: [PATCH] git-format-patch: add a new format.cc configuration variable","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-04-26T23:27:37Z","receivedAt":"2008-04-26T23:27:37Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sat, Apr 26, 2008 at 11:31:13PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> I am wary... should this not be specific to send-email?  IOW should \n> format-patch not be left alone?\n\nYes and no. :-) I first searched for a --cc option in send-email, then\nrealized that only format-patch has one. So I made it configurable,\ninstead of adding a new option to send-email for the very same purpose\nformat-patch already has an option. But I may be wrong.\n"},{"id":"75245","messageId":"7vskx8kvbu.fsf@gitster.siamese.dyndns.org","threadId":"13274","inReplyTo":"alpine.DEB.1.00.0804262330370.7944@eeepc-johanness","subject":"Re: [PATCH] git-format-patch: add a new format.cc configuration variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-27T00:14:29Z","receivedAt":"2008-04-27T00:14:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> I am wary... should this not be specific to send-email?  IOW should \n> format-patch not be left alone?\n\nYes, it should.\n"},{"id":"75254","messageId":"20080427050951.GA3946@mithlond.arda.local","threadId":"13274","inReplyTo":"7vskx8kvbu.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] bash: Add long option completion for 'git send-email'","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2008-04-27T05:09:51Z","receivedAt":"2008-04-27T05:09:51Z","isPatch":true,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"Add the following long options to be completed with 'git send-email':\n\n  --bcc --cc --cc-cmd --chain-reply-to --compose --dry-run\n  --envelope-sender --from --identity --in-reply-to --no-chain-reply-to\n  --no-signed-off-by-cc --no-suppress-from --no-thread --quiet\n  --signed-off-by-cc --smtp-pass --smtp-server --smtp-server-port\n  --smtp-ssl --smtp-user --subject --suppress-cc --suppress-from\n  --thread --to\n\nShort ones like --to and --cc are not usable for actual completion\nbecause of the shortness itself and because there are longer ones which\nstart with same letters (--thread, --compose). It's still useful to have\nthese shorter options _listed_ when user presses TAB key after typing\ntwo dashes. It gives user an idea what options are available (and --to\nand --cc are probably the most commonly used).\n\nSigned-off-by: Teemu Likonen <tlikonen@iki.fi>\n---\n contrib/completion/git-completion.bash |   20 ++++++++++++++++++++\n 1 files changed, 20 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 665a895..a9a7015 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -875,6 +875,24 @@ _git_rebase ()\n \t__gitcomp \"$(__git_refs)\"\n }\n \n+_git_send_email ()\n+{\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--*)\n+\t\t__gitcomp \"--bcc --cc --cc-cmd --chain-reply-to --compose\n+\t\t\t--dry-run --envelope-sender --from --identity\n+\t\t\t--in-reply-to --no-chain-reply-to --no-signed-off-by-cc\n+\t\t\t--no-suppress-from --no-thread --quiet\n+\t\t\t--signed-off-by-cc --smtp-pass --smtp-server\n+\t\t\t--smtp-server-port --smtp-ssl --smtp-user --subject\n+\t\t\t--suppress-cc --suppress-from --thread --to\"\n+\t\treturn\n+\t\t;;\n+\tesac\n+\t__git_complete_file\n+}\n+\n _git_config ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n@@ -1331,6 +1349,7 @@ _git ()\n \trebase)      _git_rebase ;;\n \tremote)      _git_remote ;;\n \treset)       _git_reset ;;\n+\tsend-email)  _git_send_email ;;\n \tshortlog)    _git_shortlog ;;\n \tshow)        _git_show ;;\n \tshow-branch) _git_log ;;\n@@ -1383,6 +1402,7 @@ complete -o default -o nospace -F _git_rebase git-rebase\n complete -o default -o nospace -F _git_config git-config\n complete -o default -o nospace -F _git_remote git-remote\n complete -o default -o nospace -F _git_reset git-reset\n+complete -o default -o nospace -F _git_send_email git-send-email\n complete -o default -o nospace -F _git_shortlog git-shortlog\n complete -o default -o nospace -F _git_show git-show\n complete -o default -o nospace -F _git_stash git-stash\n-- \n1.5.5.1.94.g80fd\n"},{"id":"75289","messageId":"alpine.DEB.1.00.0804271252200.16320@eeepc-johanness","threadId":"13274","inReplyTo":"20080426232737.GR4012@genesis.frugalware.org","subject":"Re: [PATCH] git-format-patch: add a new format.cc configuration variable","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-04-27T11:53:34Z","receivedAt":"2008-04-27T11:53:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 27 Apr 2008, Miklos Vajna wrote:\n\n> On Sat, Apr 26, 2008 at 11:31:13PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > I am wary... should this not be specific to send-email?  IOW should \n> > format-patch not be left alone?\n> \n> Yes and no. :-) I first searched for a --cc option in send-email, then\n> realized that only format-patch has one.\n\nYou are completely correct, sorry.  Hmm.  I would have preferred \nsend-email inserting that header, oh well.\n\nCiao,\nDscho\n"},{"id":"75291","messageId":"20080427121458.GU4012@genesis.frugalware.org","threadId":"13274","inReplyTo":"alpine.DEB.1.00.0804271252200.16320@eeepc-johanness","subject":"[PATCH] git-send-email: add a new sendemail.cc configuration variable","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-04-27T12:14:58Z","receivedAt":"2008-04-27T12:14:58Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Some projects prefer to always CC patches to a given mailing list. In\nthese cases, it's handy to configure that address once.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nOn Sun, Apr 27, 2008 at 12:53:34PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > Yes and no. :-) I first searched for a --cc option in send-email,\n> > then\n> > realized that only format-patch has one.\n>\n> You are completely correct, sorry.  Hmm.  I would have preferred\n> send-email inserting that header, oh well.\n\nHeh, no. git-send-email has a --cc option as well, just it was not\nconfigurable. Here is a one-liner which does the trick.\n\n git-send-email.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 9e568bf..cb05cf5 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -203,6 +203,7 @@ my %config_settings = (\n     \"smtpuser\" => \\$smtp_authuser,\n     \"smtppass\" => \\$smtp_authpass,\n     \"to\" => \\@to,\n+    \"cc\" => \\@initial_cc,\n     \"cccmd\" => \\$cc_cmd,\n     \"aliasfiletype\" => \\$aliasfiletype,\n     \"bcc\" => \\@bcclist,\n-- \n1.5.5.1\n"},{"id":"75329","messageId":"7vprsbf3hz.fsf@gitster.siamese.dyndns.org","threadId":"13274","inReplyTo":"20080427121458.GU4012@genesis.frugalware.org","subject":"Re: [PATCH] git-send-email: add a new sendemail.cc configuration variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-27T20:26:48Z","receivedAt":"2008-04-27T20:26:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Miklos Vajna <vmiklos@frugalware.org> writes:\n\n> Some projects prefer to always CC patches to a given mailing list. In\n> these cases, it's handy to configure that address once.\n>\n> Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n> ---\n>\n> On Sun, Apr 27, 2008 at 12:53:34PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>> > Yes and no. :-) I first searched for a --cc option in send-email,\n>> > then\n>> > realized that only format-patch has one.\n>>\n>> You are completely correct, sorry.  Hmm.  I would have preferred\n>> send-email inserting that header, oh well.\n>\n> Heh, no. git-send-email has a --cc option as well, just it was not\n> configurable. Here is a one-liner which does the trick.\n\nThanks, the idea makes sense.\n\nTests?\n"},{"id":"75336","messageId":"20080427224255.GD31919@genesis.frugalware.org","threadId":"13274","inReplyTo":"7vprsbf3hz.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-send-email: add a new sendemail.cc configuration variable","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-04-27T22:42:55Z","receivedAt":"2008-04-27T22:42:55Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sun, Apr 27, 2008 at 01:26:48PM -0700, Junio C Hamano <gitster@pobox.com> wrote:\n> Thanks, the idea makes sense.\n> \n> Tests?\n\nAs far as I see, none of the sendemail.* configuration variables have\ntests. Should I add a test for each of them?\n\nAlso, what is the preferred way of the testing method in this case?\nShould I just rely on a --dry-run output?\n"},{"id":"75337","messageId":"20080427235120.GA13948@sigill.intra.peff.net","threadId":"13274","inReplyTo":"20080427224255.GD31919@genesis.frugalware.org","subject":"Re: [PATCH] git-send-email: add a new sendemail.cc configuration variable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-04-27T23:51:21Z","receivedAt":"2008-04-27T23:51:21Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Apr 28, 2008 at 12:42:55AM +0200, Miklos Vajna wrote:\n\n> Also, what is the preferred way of the testing method in this case?\n> Should I just rely on a --dry-run output?\n\nLook in t9001; there is a fake sendmail wrapper that outputs the sent\nmessages to files. You can then inspect the files to see that the\ncorrect headers were added.\n\n-Peff\n"},{"id":"75521","messageId":"1209466607-10454-1-git-send-email-vmiklos@frugalware.org","threadId":"13274","inReplyTo":"7vprsbf3hz.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] Add tests for sendemail.cc configuration variable","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-04-29T10:56:47Z","receivedAt":"2008-04-29T10:56:47Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nOn Sun, Apr 27, 2008 at 01:26:48PM -0700, Junio C Hamano <gitster@pobox.com> wrote:\n> Thanks, the idea makes sense.\n>\n> Tests?\n\nHere it is.\n\n(Sorry for the duplication, I forgot to CC the list.)\n\n t/t9001-send-email.sh |   66 +++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 66 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex c0973b4..af655cf 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -166,4 +166,70 @@ test_expect_success 'second message is patch' '\n \tgrep \"Subject:.*Second\" msgtxt2\n '\n \n+cat >expected-show-all-headers <<\\EOF\n+0001-Second.patch\n+(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n+Dry-OK. Log says:\n+Server: relay.example.com\n+MAIL FROM:<from@example.com>\n+RCPT TO:<to@example.com>,<cc@example.com>,<author@example.com>\n+From: Example <from@example.com>\n+To: to@example.com\n+Cc: cc@example.com, A <author@example.com>\n+Subject: [PATCH 1/1] Second.\n+Date: DATE-STRING\n+Message-Id: MESSAGE-ID-STRING\n+X-Mailer: X-MAILER-STRING\n+\n+Result: OK\n+EOF\n+\n+test_expect_success 'sendemail.cc set' '\n+\tgit config sendemail.cc cc@example.com &&\n+\tgit send-email \\\n+\t\t--dry-run \\\n+\t\t--from=\"Example <from@example.com>\" \\\n+\t\t--to=to@example.com \\\n+\t\t--smtp-server relay.example.com \\\n+\t\t$patches |\n+\tsed\t-e \"s/^\\(Date:\\).*/\\1 DATE-STRING/\" \\\n+\t\t-e \"s/^\\(Message-Id:\\).*/\\1 MESSAGE-ID-STRING/\" \\\n+\t\t-e \"s/^\\(X-Mailer:\\).*/\\1 X-MAILER-STRING/\" \\\n+\t\t>actual-show-all-headers &&\n+\ttest_cmp expected-show-all-headers actual-show-all-headers\n+'\n+\n+cat >expected-show-all-headers <<\\EOF\n+0001-Second.patch\n+(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n+Dry-OK. Log says:\n+Server: relay.example.com\n+MAIL FROM:<from@example.com>\n+RCPT TO:<to@example.com>,<author@example.com>\n+From: Example <from@example.com>\n+To: to@example.com\n+Cc: A <author@example.com>\n+Subject: [PATCH 1/1] Second.\n+Date: DATE-STRING\n+Message-Id: MESSAGE-ID-STRING\n+X-Mailer: X-MAILER-STRING\n+\n+Result: OK\n+EOF\n+\n+test_expect_success 'sendemail.cc unset' '\n+\tgit config --unset sendemail.cc &&\n+\tgit send-email \\\n+\t\t--dry-run \\\n+\t\t--from=\"Example <from@example.com>\" \\\n+\t\t--to=to@example.com \\\n+\t\t--smtp-server relay.example.com \\\n+\t\t$patches |\n+\tsed\t-e \"s/^\\(Date:\\).*/\\1 DATE-STRING/\" \\\n+\t\t-e \"s/^\\(Message-Id:\\).*/\\1 MESSAGE-ID-STRING/\" \\\n+\t\t-e \"s/^\\(X-Mailer:\\).*/\\1 X-MAILER-STRING/\" \\\n+\t\t>actual-show-all-headers &&\n+\ttest_cmp expected-show-all-headers actual-show-all-headers\n+'\n+\n test_done\n-- \n1.5.5.1.100.ge64d7\n"},{"id":"75551","messageId":"76718490804291021m4d6827d3h522fe61b791ae067@mail.gmail.com","threadId":"13274","inReplyTo":"alpine.DEB.1.00.0804271252200.16320@eeepc-johanness","subject":"Re: [PATCH] git-format-patch: add a new format.cc configuration variable","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2008-04-29T17:21:36Z","receivedAt":"2008-04-29T17:21:36Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Sun, Apr 27, 2008 at 7:53 AM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n>\n>  On Sun, 27 Apr 2008, Miklos Vajna wrote:\n>\n>  > On Sat, Apr 26, 2008 at 11:31:13PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>  > > I am wary... should this not be specific to send-email?  IOW should\n>  > > format-patch not be left alone?\n>  >\n>  > Yes and no. :-) I first searched for a --cc option in send-email, then\n>  > realized that only format-patch has one.\n>\n>  You are completely correct, sorry.  Hmm.  I would have preferred\n>  send-email inserting that header, oh well.\n\nYou can do something like:\n\n[sendemail]\n  cccmd = \"sh -c 'echo address@example.com'\"\n\nj.\n"}]}