{"thread":{"id":"18067","subject":"Changing the defaults for send-email / suppress-cc ?","startedAt":"2009-02-28T19:29:39Z","lastAt":"2009-03-01T18:09:15Z","messageCount":10,"participants":["Paul Gortmaker","Junio C Hamano","Jay Soffian","Teemu Likonen","Nanako Shiraishi","Sverre Rabbelier"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"106550","messageId":"7d1d9c250902281129t1ea0d9d0k796d97bdd0af046d@mail.gmail.com","threadId":"18067","inReplyTo":null,"subject":"Changing the defaults for send-email / suppress-cc ?","fromName":"Paul Gortmaker","fromEmail":"paul.gortmaker@windriver.com","sentAt":"2009-02-28T19:29:39Z","receivedAt":"2009-02-28T19:29:39Z","isPatch":false,"sender":{"key":"paul.gortmaker@windriver.com","avatar":null},"body":"I've been involved in helping people who are new git users, and the\none thing that seems to violate the principle of least surprise for\nthem is the default setting for the sendemail.suppresscc -- in that\nthe new users don't expect the additional CC lines to be automatically\nadded based on what is present in the content of the mbox\n(format-patch output).\n\nThe messages from send-email that indicate it is going to add CC lines\nbased on SOB etc. come *after* the last input from the user, and so\nthey don't have an opportunity to jump in and prevent the extra\ne-mails from going out to whoever happens to be listed in the patch.\n(Lets assume for the moment, that they didn't see \"--dry-run\", or\nsimply figured the process looked fairly straightforward, and didn't\nsee the need for it.)\n\nHere is the use case which I suspect is fairly pervasive, and that\nI've already seen several times:\n\n1) User is working on something involving kernel version X, which is\nsome amount behind the current mainstream HEAD.  (Okay, doesn't have\nto be kernel, could even be git itself.)\n\n2) They've created a branch off of X and they've added their own\ncommits, and also cherry picked relevant commits from upstream that\nhappened between X and HEAD into their branch.   One of the features\nthey've cherry picked onto their branch is a 25 patch series that has\n\"Signed-off-by: miserable@bofh.com\" in it, a miserable person who\nhates extra-emails.\n\n3) They run \"git format-patch -n --thread -o foo X..mybranch\"\n\n4) They run \"git send-email --to coworker@mycompany.com foo\"  so their\nbuddy within the company can have an mbox patchset.\n\n5) They recoil in horror while smashing ^C as they try to stop\nsend-email from spamming miserable@bofh.com with 25 of his own\npatches.\n\nIn light of this, I've simply advised new users to run something like:\n\ngit config --global sendemail.suppresscc all\n\n...just so that they won't accidentally do what I've described in the above.\n\nApologies if this has been discussed before; I took a quick scan of my\narchive and didn't see any discussions on it.  With the recent thread\nabout warning people of non-back compatible changes that will appear\npost 1.6.2 -- I thought perhaps this was a good time to\nmention/consider it.\n\nI'm not sure what the right thing to do here is -- I suspect if you\nmade suppress-cc=all the default, then there would be more experienced\nusers that would complain about having to explicitly add a\nsuppress-cc=self to get the old behaviour?  Would that be acceptable?\nI don't know...\n\nThanks,\nPaul.\n"},{"id":"106567","messageId":"7vsklycct9.fsf@gitster.siamese.dyndns.org","threadId":"18067","inReplyTo":"7d1d9c250902281129t1ea0d9d0k796d97bdd0af046d@mail.gmail.com","subject":"Re: Changing the defaults for send-email / suppress-cc ?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-01T00:21:54Z","receivedAt":"2009-03-01T00:21:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Paul Gortmaker <paul.gortmaker@windriver.com> writes:\n\n> In light of this, I've simply advised new users to run something like:\n>\n> git config --global sendemail.suppresscc all\n>\n> ...just so that they won't accidentally do what I've described in the above.\n\n> Apologies if this has been discussed before; I took a quick scan of my\n> archive and didn't see any discussions on it.\n\nI think I've seen discussions in the distant past but not very recently.\nIIRC some people had exactly the same reaction as you did, and were loud,\nwhile others were happy with the default, but weren't as loud.\n\nBut loudness depends on how annoyed they are, and unhappy people are\nlouder than others, so we cannot judge much from the loudness alone.\n\n> With the recent thread\n> about warning people of non-back compatible changes that will appear\n> post 1.6.2 -- I thought perhaps this was a good time to\n> mention/consider it.\n\nUnless you are a single project person, or have groups of hosts that share\nthe home directory that is dedicated for working only on a single project,\nusing $HOME/.gitconfig for this is a bad advice to give in general; as I\nthink this really depends on what you are working on.\n\nI do have \"sendemail.suppressfrom\" and \"sendemail.signedoffcc = false\" in\nmy repository configuration, but not in global configuration.\n\nMy point is that the default does not suit *me* at least.  But it may or\nmay not match what you want as a default.  I suspect many people are in\nthe same boat as I am.\n\n> I'm not sure what the right thing to do here is -- I suspect if you made\n> suppress-cc=all the default, then there would be more experienced users\n> that would complain about having to explicitly add a suppress-cc=self to\n> get the old behaviour?  Would that be acceptable?\n\nNo matter what different default you choose, there will be people who\ncomplain about it as long as it is not exactly the default they want.\n\nThe only thing I could think of offhand that you could do safely to remedy\nthe situation is to make the command fail until you explicitly set your\ndefault via the configuration, but even then, it is not entirely safe.\n\nYou will hear from angry people who use their own wrapper script to \"git\nsend-email\" that gives all necessary options from the command line and now\nthey are forced to add configuration to their repository, even though the\nconfig is never used because their script overrides it from the command\nline.\n\nSo, I dunno.\n"},{"id":"106569","messageId":"7d1d9c250902281732m7293330bt108b70a850dc5cb9@mail.gmail.com","threadId":"18067","inReplyTo":"7vsklycct9.fsf@gitster.siamese.dyndns.org","subject":"Re: Changing the defaults for send-email / suppress-cc ?","fromName":"Paul Gortmaker","fromEmail":"paul.gortmaker@windriver.com","sentAt":"2009-03-01T01:32:45Z","receivedAt":"2009-03-01T01:32:45Z","isPatch":false,"sender":{"key":"paul.gortmaker@windriver.com","avatar":null},"body":"On Sat, Feb 28, 2009 at 7:21 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Paul Gortmaker <paul.gortmaker@windriver.com> writes:\n>\n>> In light of this, I've simply advised new users to run something like:\n>>\n>> git config --global sendemail.suppresscc all\n>>\n>> ...just so that they won't accidentally do what I've described in the above.\n>\n>> Apologies if this has been discussed before; I took a quick scan of my\n>> archive and didn't see any discussions on it.\n>\n> I think I've seen discussions in the distant past but not very recently.\n> IIRC some people had exactly the same reaction as you did, and were loud,\n> while others were happy with the default, but weren't as loud.\n>\n> But loudness depends on how annoyed they are, and unhappy people are\n> louder than others, so we cannot judge much from the loudness alone.\n\nThanks for the reply -- I'm not interested in being \"loud\"  ;-)   But\nI think I'm in an interesting situation where I see people who are not\nnecessarily wanting to use git, but are required to use git in order\nto do their daily activities.  So they approach it with some\napprehension and, given what human nature is, are looking for reasons\nto justify that apprehension.\n\n>\n>> With the recent thread\n>> about warning people of non-back compatible changes that will appear\n>> post 1.6.2 -- I thought perhaps this was a good time to\n>> mention/consider it.\n>\n> Unless you are a single project person, or have groups of hosts that share\n> the home directory that is dedicated for working only on a single project,\n> using $HOME/.gitconfig for this is a bad advice to give in general; as I\n> think this really depends on what you are working on.\n\nYes, well it is the right solution for the new users I'm working with,\nsince I know what their focus is, but that wasn't really where I\nwanted the discussion to focus.\n\nMy point was that I've seen these new users get scared off by having\ngit send-email essentially embarrass them, and that it would be a\nshame to have people in general get the wrong impression about git\nfrom this one small setting, when it is such a useful tool.  Really,\nit does tend to violate the principle of least surprise for the new\nuser.  If there is a new user who is a bit apprehensive about git, the\ndefaults for \"suppress-cc\" can give them all the evidence they need to\njustify their fear of it, and then the FUD starts.   So, I think this\nis a case where \"do nothing, unless explicitly asked\" is perhaps the\nwise choice.  That was the only thing I wanted to draw attention to.\n\nThanks,\nPaul.\n"},{"id":"106577","messageId":"1235879630-39439-1-git-send-email-jaysoffian@gmail.com","threadId":"18067","inReplyTo":"7d1d9c250902281732m7293330bt108b70a850dc5cb9@mail.gmail.com","subject":"[PATCH] send-email: confirm auto cc before sending","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-01T03:53:50Z","receivedAt":"2009-03-01T03:53:50Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"send-email violates the principle of least surprise by automatically\ncc'ing additional recipients without even bothering to confirm this with\nthe user first.\n\nThis patch teaches send-email a new option --confirm-cc. In the case\nwhere send-email has automatically added additional Cc recipients, it\nwill confirm the recipients with the user before sending.\n\nIt defaults to true unless another of the cc-related suppression options\nhas been specified, in which case it defaults to false.\n---\nUntested patch, just soliciting ideas. I actually don't like this patch\nas is. I think a more general purpose --confirm option that takes\nmultiple values is in order:\n\n --confirm=never   never confirms\n --confirm=cc      confirms only when send-email has automagically added\n                   additional recipient\n --confirm=always  always confirms\n\nThe default would be --confirm=cc unless the user has specified any of\nthe other Cc suppression options, which to me indicates the user knows\nwhat they are doing.\n\nj.\n\n git-send-email.perl |   29 +++++++++++++++++++++++++++--\n 1 files changed, 27 insertions(+), 2 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex adf7ecb..d3e718e 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -75,6 +75,7 @@ git send-email [options] <file | directory | rev-list options >\n     --[no-]thread                  * Use In-Reply-To: field. Default on.\n \n   Administering:\n+    --confirm-cc                   * Confirm automatic cc'd before sending.\n     --quiet                        * Output one line of info per email.\n     --dry-run                      * Don't actually send the emails.\n     --[no-]validate                * Perform patch sanity checks. Default on.\n@@ -181,7 +182,7 @@ sub do_edit {\n my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd);\n my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_encryption);\n my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);\n-my ($validate);\n+my ($validate, $confirm_cc);\n my (@suppress_cc);\n \n my %config_bool_settings = (\n@@ -190,6 +191,7 @@ my %config_bool_settings = (\n     \"suppressfrom\" => [\\$suppress_from, undef],\n     \"signedoffbycc\" => [\\$signed_off_by_cc, undef],\n     \"signedoffcc\" => [\\$signed_off_by_cc, undef],      # Deprecated\n+    \"confirmcc\"   => [\\$confirm_cc, undef],\n     \"validate\" => [\\$validate, 1],\n );\n \n@@ -258,6 +260,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"suppress-from!\" => \\$suppress_from,\n \t\t    \"suppress-cc=s\" => \\@suppress_cc,\n \t\t    \"signed-off-cc|signed-off-by-cc!\" => \\$signed_off_by_cc,\n+\t\t    \"confirm-cc\" => \\$confirm_cc,\n \t\t    \"dry-run\" => \\$dry_run,\n \t\t    \"envelope-sender=s\" => \\$envelope_sender,\n \t\t    \"thread!\" => \\$thread,\n@@ -346,6 +349,12 @@ if ($suppress_cc{'body'}) {\n \tdelete $suppress_cc{'body'};\n }\n \n+if (!defined $confirm_cc) {\n+    # defaults to true unless user has specified any of the other cc options\n+    $confirm_cc = scalar %suppress_cc ? 0 : 1;\n+}\n+\n+\n # Debugging, print out the suppressions.\n if (0) {\n \tprint \"suppressions:\\n\";\n@@ -943,7 +952,7 @@ foreach my $t (@files) {\n \tmy $author_encoding;\n \tmy $has_content_type;\n \tmy $body_encoding;\n-\t@cc = @initial_cc;\n+\t@cc = ();\n \t@xh = ();\n \tmy $input_format = undef;\n \tmy @header = ();\n@@ -1080,6 +1089,22 @@ foreach my $t (@files) {\n \t\t}\n \t}\n \n+\tif (@cc and $confirm_cc) {\n+\t\tprint \"Automatically cc'ing:\\n\";\n+\t\tprint \"\t  $_\\n\" for each @cc;\n+\t\tprint \"Okay? \"\n+\t\twhile (1) {\n+\t\t\t$_ = $term->readline(\"Okay (y/n)?\");\n+\t\t\tlast if defined $_;\n+\t\t\tprint \"\\n\";\n+\t\t}\n+\t\tif (/n/i) {\n+\t\t\t$message_id = undef;\n+\t\t\tcontinue;\n+\t\t}\n+\t}\n+\tpush(@cc, @initial_cc);\n+\n \tsend_message();\n \n \t# set up for the next message\n-- \n1.6.2.rc1.309.g5f417\n"},{"id":"106579","messageId":"87ljrphjxv.fsf@iki.fi","threadId":"18067","inReplyTo":"7d1d9c250902281129t1ea0d9d0k796d97bdd0af046d@mail.gmail.com","subject":"Re: Changing the defaults for send-email / suppress-cc ?","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2009-03-01T05:49:00Z","receivedAt":"2009-03-01T05:49:00Z","isPatch":false,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"On 2009-02-28 14:29 (-0500), Paul Gortmaker wrote:\n\n> I've been involved in helping people who are new git users, and the\n> one thing that seems to violate the principle of least surprise for\n> them is the default setting for the sendemail.suppresscc -- in that\n> the new users don't expect the additional CC lines to be automatically\n> added based on what is present in the content of the mbox\n> (format-patch output).\n\n> In light of this, I've simply advised new users to run something like:\n>\n> git config --global sendemail.suppresscc all\n>\n> ...just so that they won't accidentally do what I've described in the\n> above.\n\nAgreed. In the past I have sent a couple of test patches to wrong places\nbecause of these automatic CCs. I think that send-email or any e-mail\nclient should only send mail for addresses which user has explicitly\nselected or otherwise confirmed.\n\nWith a time machine I would make the opposite option for send-email:\nsomething like sendemail.autocc and --autocc=. Then user would configure\ndifferent recipient categories who she wants to send automatic CCs. It's\neasier to think this way. But we don't have a time machine so at least\nsome kind confirm message would be nice.\n"},{"id":"106582","messageId":"20090301153000.6117@nanako3.lavabit.com","threadId":"18067","inReplyTo":"7vsklycct9.fsf@gitster.siamese.dyndns.org","subject":"Re: Changing the defaults for send-email / suppress-cc ?","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-03-01T06:30:00Z","receivedAt":"2009-03-01T06:30:00Z","isPatch":false,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Junio C Hamano <gitster@pobox.com>:\n\n> No matter what different default you choose, there will be people who\n> complain about it as long as it is not exactly the default they want.\n>\n> The only thing I could think of offhand that you could do safely to remedy\n> the situation is to make the command fail until you explicitly set your\n> default via the configuration, but even then, it is not entirely safe.\n>\n> You will hear from angry people who use their own wrapper script to \"git\n> send-email\" that gives all necessary options from the command line and now\n> they are forced to add configuration to their repository, even though the\n> config is never used because their script overrides it from the command\n> line.\n>\n> So, I dunno.\n\nIsn't it an option to introduce a new program, say 'git send', that\nreimplements what 'git send-email' is meant to be used for, but has a\nbetter implementation and a better default setting?\n\nYou have a precedence of doing so when you introduced 'git am'. You\ncontined to maintain 'git applymbox' to keep old people happy. You\ntaught new people to use 'git am', and waited until old people learn to\nlike the new command with a shorter name and a saner behavior. After a\ncertain period of time, you deprecated and removed the original program.\n\nd1c5f2a42d7b5c0e3d3862212dea1f09809c4963 \"Add git-am, applymbox replacement\"\nhttp://article.gmane.org/gmane.comp.version-control.git/44376\nhttp://article.gmane.org/gmane.comp.version-control.git/47785\n\nI don't know much about the technical details, but I saw there were a\nfew discussion threads about improving 'git send-email'; one of the\nrecent ones was this.\n\nhttp://article.gmane.org/gmane.comp.version-control.git/109791\n\nI also saw the original author (Greg?) said that one of the input\nformats 'git send-email' supports is not worth supporting, or sth like\nthat. A reimplemention to introduce 'git send' may be a good time to\ndeprecate and remove that old input format.\n\nOr is the migration plan like the one you used when you migrated 'git\napplymbox' to 'git am' considered unacceptable by now, because git is a\nlot more mature than it used to be back then?\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"106585","messageId":"76718490902282259q39da4267r34d169ec200704ba@mail.gmail.com","threadId":"18067","inReplyTo":"20090301153000.6117@nanako3.lavabit.com","subject":"Re: Changing the defaults for send-email / suppress-cc ?","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-01T06:59:02Z","receivedAt":"2009-03-01T06:59:02Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Sun, Mar 1, 2009 at 1:30 AM, Nanako Shiraishi <nanako3@lavabit.com> wrote:\n> Isn't it an option to introduce a new program, say 'git send', that\n> reimplements what 'git send-email' is meant to be used for, but has a\n> better implementation and a better default setting?\n\nI would, at some point, like to unify format-patch, send-email, and\npossible imap-send. I envision being able to \"git format-patch\n--email\" (and possibly \"git format-patch --imap\").\n\nI don't have any illusion that writing my own SMTP client in C is much\nfun, so I was going to see if it was reasonable to link format-patch\nagainst msmtp. OTOH, I don't want to bloat the git binary, so it may\njust be best to have format-patch be able to run msmtp automagically\nwhen it is called with \"--email\".\n\nOr something. I haven't thought real hard about it yet. :-)\n\nj.\n"},{"id":"106586","messageId":"76718490902282301v141ce35ajc7e66f984f2f3a39@mail.gmail.com","threadId":"18067","inReplyTo":"76718490902282259q39da4267r34d169ec200704ba@mail.gmail.com","subject":"Re: Changing the defaults for send-email / suppress-cc ?","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-01T07:01:18Z","receivedAt":"2009-03-01T07:01:18Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Sun, Mar 1, 2009 at 1:59 AM, Jay Soffian <jaysoffian@gmail.com> wrote:\n> I don't have any illusion that writing my own SMTP client in C is much\n> fun, so I was going to see if it was reasonable to link format-patch\n> against msmtp. OTOH, I don't want to bloat the git binary, so it may\n> just be best to have format-patch be able to run msmtp automagically\n> when it is called with \"--email\".\n>\n> Or something. I haven't thought real hard about it yet. :-)\n\nOTOH, I like having format-patch spit out the patches so I can give\nthem a final look-over before sending them. So I dunno if it is worth\nthis. Perhaps format-patch should be able to invoke an SMTP server\nautomatically, in the same way that send-email can, but then again,\nperhaps not.\n\nMaybe I should stop this late night thinking out loud before I annoy\none too many maintainers. :-)\n\nj.\n"},{"id":"106587","messageId":"76718490902282305m127eb901xac9495f3877cce47@mail.gmail.com","threadId":"18067","inReplyTo":"76718490902282259q39da4267r34d169ec200704ba@mail.gmail.com","subject":"Re: Changing the defaults for send-email / suppress-cc ?","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-01T07:05:52Z","receivedAt":"2009-03-01T07:05:52Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Sun, Mar 1, 2009 at 1:59 AM, Jay Soffian <jaysoffian@gmail.com> wrote:\n> fun, so I was going to see if it was reasonable to link format-patch\n> against msmtp. OTOH, I don't want to bloat the git binary, so it may\n\nAnd msmtp is GPLv3, so nevermind anyway.\n\nj.\n"},{"id":"106630","messageId":"fabb9a1e0903011009s6f89b680mf732843fab233358@mail.gmail.com","threadId":"18067","inReplyTo":"1235879630-39439-1-git-send-email-jaysoffian@gmail.com","subject":"Re: [PATCH] send-email: confirm auto cc before sending","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-03-01T18:09:15Z","receivedAt":"2009-03-01T18:09:15Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Sun, Mar 1, 2009 at 04:53, Jay Soffian <jaysoffian@gmail.com> wrote:\n> Untested patch, just soliciting ideas.\n\nWith a config option to turn it on permanently this would be very nice\nto have. It personally annoys me that it decides who to cc (I already\ndo that manually, thank you very much).\nSo, FWIW, I like this idea :).\n\n-- \nCheers,\n\nSverre Rabbelier\n"}]}