{"thread":{"id":"41485","subject":"[PATCH] push: shorten \"push.default is unset\" warning message","startedAt":"2016-02-23T14:59:04Z","lastAt":"2016-02-26T10:54:01Z","messageCount":11,"participants":["Matthieu Moy","Junio C Hamano","Philip Oakley","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"279033","messageId":"000001530ea408ed-2b71a34a-32bb-434c-bba5-fdac28193e9c-000000@eu-west-1.amazonses.com","threadId":"41485","inReplyTo":null,"subject":"[PATCH] push: shorten \"push.default is unset\" warning message","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-23T14:59:04Z","receivedAt":"2016-02-23T14:59:04Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"From: Matthieu Moy <matthieu.moy@imag.fr>\n\nThe warning was purposely long, both to explain the situation properly\nand to give a strong incentive to set push.default explicitly. This was\nimportant before the 2.0 transition, and remained important for a while\nafter, so that new users get push.default explicitly in their\nconfiguration and do not experience inconsistent behavior if they ever\nused an older version of Git.\n\nThe warning has been there since version 1.8.0 (Oct 2012), hence we can\nexpect the vast majority of current Git users to have been exposed to\nit, and most of them have already set push.default explicitly. The\nswitch from 'matching' to 'simple' was planned for 2.0 (May 2014), but\nactually happened only for 2.3 (Feb 2015).\n\nThe warning is mostly seen by beginners, who have not set their\npush.default configuration (yet). For many of them, the warning is\nconfusing because it talks about concepts that they have not learned and\nasks them a choice that they are not able to make yet. See for example\n\n  http://stackoverflow.com/questions/13148066/warning-push-default-is-unset-its-implicit-value-is-changing-in-git-2-0\n\n(1260 votes for the question, 1824 for the answer as of writing)\n\nShorten the warning and mention only the way to remove the warning\nwithout changing the behavior. Keep a pointer to the documentation so\nthat people willing to learn can still find the alternative behaviors\neasily.\n\nEventually, the warning should be removed completely, but this can wait\na couple more releases or years.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n builtin/push.c | 20 +++-----------------\n 1 file changed, 3 insertions(+), 17 deletions(-)\n\ndiff --git a/builtin/push.c b/builtin/push.c\nindex 960ffc3..00eba2f 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -205,26 +205,12 @@ static void setup_push_current(struct remote *remote, struct branch *branch)\n }\n \n static char warn_unspecified_push_default_msg[] =\n-N_(\"push.default is unset; its implicit value has changed in\\n\"\n-   \"Git 2.0 from 'matching' to 'simple'. To squelch this message\\n\"\n-   \"and maintain the traditional behavior, use:\\n\"\n-   \"\\n\"\n-   \"  git config --global push.default matching\\n\"\n-   \"\\n\"\n-   \"To squelch this message and adopt the new behavior now, use:\\n\"\n+N_(\"push.default is unset; its default value has changed in Git 2.0 from\\n\"\n+   \"'matching' to 'simple'. To squelch this message and adopt the new behavior, use:\\n\"\n    \"\\n\"\n    \"  git config --global push.default simple\\n\"\n    \"\\n\"\n-   \"When push.default is set to 'matching', git will push local branches\\n\"\n-   \"to the remote branches that already exist with the same name.\\n\"\n-   \"\\n\"\n-   \"Since Git 2.0, Git defaults to the more conservative 'simple'\\n\"\n-   \"behavior, which only pushes the current branch to the corresponding\\n\"\n-   \"remote branch that 'git pull' uses to update the current branch.\\n\"\n-   \"\\n\"\n-   \"See 'git help config' and search for 'push.default' for further information.\\n\"\n-   \"(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode\\n\"\n-   \"'current' instead of 'simple' if you sometimes use older versions of Git)\");\n+   \"See 'git help config' and search for 'push.default' for further information.\");\n \n static void warn_unspecified_push_default_configuration(void)\n {\n\n--\nhttps://github.com/git/git/pull/201\n"},{"id":"279050","messageId":"xmqqtwkz1c4b.fsf@gitster.mtv.corp.google.com","threadId":"41485","inReplyTo":"000001530ea408ed-2b71a34a-32bb-434c-bba5-fdac28193e9c-000000@eu-west-1.amazonses.com","subject":"Re: [PATCH] push: shorten \"push.default is unset\" warning message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-23T19:05:08Z","receivedAt":"2016-02-23T19:05:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> The warning is mostly seen by beginners, who have not set their\n> push.default configuration (yet). For many of them, the warning is\n> confusing because it talks about concepts that they have not learned and\n> asks them a choice that they are not able to make yet. See for example\n>\n>   http://stackoverflow.com/questions/13148066/warning-push-default-is-unset-its-implicit-value-is-changing-in-git-2-0\n>\n> (1260 votes for the question, 1824 for the answer as of writing)\n\nThe punchline of that question is:\n\n    I can obviously set it to one of the values mentioned, but what do\n    they mean? What's the difference between simple and matching?\n\nIt tells us that \"See 'git help config'\" is not such an effective\nmessage to help such a user.\n\n> Shorten the warning and mention only the way to remove the warning\n> without changing the behavior. Keep a pointer to the documentation so\n> that people willing to learn can still find the alternative behaviors\n> easily.\n\nWhile I admit that I usually am the most cautious one when dealing\nwith any change, I am not sure if this rephrasing helps very much.\nAs we saw, the sentence you kept, \"See 'git help config'\", is not\neffective in helping those stackoverflow users.  Removal of the\nother parts of the message the patch does does make sense, as we\nknow these users do not read, so they are merely noisy black pixels\non the screen.\n\nIf most people are happy with \"simple\" (and certainly that was the\nassumption and hope behind the transtion we made at 2.0), we may be\nbetter off removing the warning altogether.  Keeping \"and adopt the\nnew behaviour\" part pretends to be offering a chance to make an\ninformed choice, but it will forever be unclear to the non-reader\nwhat the implication of not adopting the new behaviour is anyway, so\noverall we won't see reduced hits at stackoverflow with this change.\n\nAfter all, push.default configuration is hardly the only case where\nthere are other ways to use Git that may match the user's situation\nbetter, and we do not advertise \"Oh by the way you can do things\ndifferently, study the manual\" for any of them with a warning\nmessage like this.  Those who want to do different things know to\nseek settings to tweak.\n\nThe above analysis considers _only_ those who go to stackoverflow.\nFor those who do read, perhaps \"See 'git config help'\" may have some\nvalue, but again, many aspects of the system can be tweaked, and we\ndo not advertise that everywhere, so...\n\n> Eventually, the warning should be removed completely, but this can wait\n> a couple more releases or years.\n\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n>  builtin/push.c | 20 +++-----------------\n>  1 file changed, 3 insertions(+), 17 deletions(-)\n>\n> diff --git a/builtin/push.c b/builtin/push.c\n> index 960ffc3..00eba2f 100644\n> --- a/builtin/push.c\n> +++ b/builtin/push.c\n> @@ -205,26 +205,12 @@ static void setup_push_current(struct remote *remote, struct branch *branch)\n>  }\n>  \n>  static char warn_unspecified_push_default_msg[] =\n> -N_(\"push.default is unset; its implicit value has changed in\\n\"\n> -   \"Git 2.0 from 'matching' to 'simple'. To squelch this message\\n\"\n> -   \"and maintain the traditional behavior, use:\\n\"\n> -   \"\\n\"\n> -   \"  git config --global push.default matching\\n\"\n> -   \"\\n\"\n> -   \"To squelch this message and adopt the new behavior now, use:\\n\"\n> +N_(\"push.default is unset; its default value has changed in Git 2.0 from\\n\"\n> +   \"'matching' to 'simple'. To squelch this message and adopt the new behavior, use:\\n\"\n>     \"\\n\"\n>     \"  git config --global push.default simple\\n\"\n>     \"\\n\"\n> -   \"When push.default is set to 'matching', git will push local branches\\n\"\n> -   \"to the remote branches that already exist with the same name.\\n\"\n> -   \"\\n\"\n> -   \"Since Git 2.0, Git defaults to the more conservative 'simple'\\n\"\n> -   \"behavior, which only pushes the current branch to the corresponding\\n\"\n> -   \"remote branch that 'git pull' uses to update the current branch.\\n\"\n> -   \"\\n\"\n> -   \"See 'git help config' and search for 'push.default' for further information.\\n\"\n> -   \"(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode\\n\"\n> -   \"'current' instead of 'simple' if you sometimes use older versions of Git)\");\n> +   \"See 'git help config' and search for 'push.default' for further information.\");\n>  \n>  static void warn_unspecified_push_default_configuration(void)\n>  {\n>\n> --\n> https://github.com/git/git/pull/201\n"},{"id":"279055","messageId":"vpqd1rngqf3.fsf@anie.imag.fr","threadId":"41485","inReplyTo":"xmqqtwkz1c4b.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] push: shorten \"push.default is unset\" warning message","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-02-23T19:47:12Z","receivedAt":"2016-02-23T19:47:12Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> The punchline of that question is:\n>\n>     I can obviously set it to one of the values mentioned, but what do\n>     they mean? What's the difference between simple and matching?\n>\n> It tells us that \"See 'git help config'\" is not such an effective\n> message to help such a user.\n\n[ The teacher inside me speaks ]\n\nDon't underestimate the ability to ignore any pointer to the doc from\nmany users.\n\nIn many case, when a student comes to me scared about an error or\nwarning message, I just ask the student to read the message to me. If\nit's in english, I sometimes have to add \"so, what does this mean in\nFrench\", and in many cases it's sufficient.\n\n>> Shorten the warning and mention only the way to remove the warning\n>> without changing the behavior. Keep a pointer to the documentation so\n>> that people willing to learn can still find the alternative behaviors\n>> easily.\n>\n> While I admit that I usually am the most cautious one when dealing\n> with any change, I am not sure if this rephrasing helps very much.\n> As we saw, the sentence you kept, \"See 'git help config'\", is not\n> effective in helping those stackoverflow users.\n\nRight. But assuming someone who reads the complete message, I found that\nkeeping only the first lines without a pointer to the doc make the text\nkind of mysterious:\n\n  warning: push.default is unset; its default value has changed in Git 2.0 from\n  'matching' to 'simple'. To squelch this message and adopt the new behavior, use:\n  \n    git config --global push.default simple\n\nAlone, this really looks like a magic formula like \"I'm showing you this\nwarning just to bug you, but you can get rid of it with ...\".\n\n> If most people are happy with \"simple\" (and certainly that was the\n> assumption and hope behind the transtion we made at 2.0), we may be\n> better off removing the warning altogether.\n\nTo me, this is the plan. I have no strong objection in removing it\ncompletely, but I think it makes sense to keep a lightweight one for a\nwhile: if people use different machines with different Git versions\n(especially if they ever use a version in the interval 2.0 to 2.3 which\nclaims to use simple but actually do not), then these people may\nappreciate an incentive to set push.default.\n\nOTOH, if they use different Git versions, they will eventually get the\nmessage.\n\n> After all, push.default configuration is hardly the only case where\n> there are other ways to use Git that may match the user's situation\n> better, and we do not advertise \"Oh by the way you can do things\n> differently, study the manual\" for any of them with a warning\n> message like this.  Those who want to do different things know to\n> seek settings to tweak.\n\nI completely agree with this.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"279062","messageId":"A8668075C5244F34A8C21A22F91ED823@PhilipOakley","threadId":"41485","inReplyTo":"000001530ea408ed-2b71a34a-32bb-434c-bba5-fdac28193e9c-000000@eu-west-1.amazonses.com","subject":"Re: [PATCH] push: shorten \"push.default is unset\" warning message","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2016-02-23T20:35:12Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Matthieu Moy\" <Matthieu.Moy@imag.fr>\n> From: Matthieu Moy <matthieu.moy@imag.fr>\n>\n> The warning was purposely long, both to explain the situation properly\n> and to give a strong incentive to set push.default explicitly. This was\n> important before the 2.0 transition, and remained important for a while\n> after, so that new users get push.default explicitly in their\n> configuration and do not experience inconsistent behavior if they ever\n> used an older version of Git.\n>\n> The warning has been there since version 1.8.0 (Oct 2012), hence we can\n> expect the vast majority of current Git users to have been exposed to\n> it, and most of them have already set push.default explicitly. The\n> switch from 'matching' to 'simple' was planned for 2.0 (May 2014), but\n> actually happened only for 2.3 (Feb 2015).\n>\n> The warning is mostly seen by beginners, who have not set their\n> push.default configuration (yet). For many of them, the warning is\n> confusing because it talks about concepts that they have not learned and\n> asks them a choice that they are not able to make yet. See for example\n>\n> \n> http://stackoverflow.com/questions/13148066/warning-push-default-is-unset-its-implicit-value-is-changing-in-git-2-0\n>\n\nShouldn't this also update the 'push' man page to state what the new default \nis. @gerry's comment to the top answer \nhttp://stackoverflow.com/a/13148313/717355 highlights that the word 'simple' \nis not even mentioned in the 'push' man page.\n\n\n> (1260 votes for the question, 1824 for the answer as of writing)\n>\n> Shorten the warning and mention only the way to remove the warning\n> without changing the behavior. Keep a pointer to the documentation so\n> that people willing to learn can still find the alternative behaviors\n> easily.\n>\n> Eventually, the warning should be removed completely, but this can wait\n> a couple more releases or years.\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n> builtin/push.c | 20 +++-----------------\n> 1 file changed, 3 insertions(+), 17 deletions(-)\n>\n> diff --git a/builtin/push.c b/builtin/push.c\n> index 960ffc3..00eba2f 100644\n> --- a/builtin/push.c\n> +++ b/builtin/push.c\n> @@ -205,26 +205,12 @@ static void setup_push_current(struct remote \n> *remote, struct branch *branch)\n> }\n>\n> static char warn_unspecified_push_default_msg[] =\n> -N_(\"push.default is unset; its implicit value has changed in\\n\"\n> -   \"Git 2.0 from 'matching' to 'simple'. To squelch this message\\n\"\n> -   \"and maintain the traditional behavior, use:\\n\"\n> -   \"\\n\"\n> -   \"  git config --global push.default matching\\n\"\n> -   \"\\n\"\n> -   \"To squelch this message and adopt the new behavior now, use:\\n\"\n> +N_(\"push.default is unset; its default value has changed in Git 2.0 \n> from\\n\"\n> +   \"'matching' to 'simple'. To squelch this message and adopt the new \n> behavior, use:\\n\"\n>    \"\\n\"\n>    \"  git config --global push.default simple\\n\"\n>    \"\\n\"\n> -   \"When push.default is set to 'matching', git will push local \n> branches\\n\"\n> -   \"to the remote branches that already exist with the same name.\\n\"\n> -   \"\\n\"\n> -   \"Since Git 2.0, Git defaults to the more conservative 'simple'\\n\"\n> -   \"behavior, which only pushes the current branch to the \n> corresponding\\n\"\n> -   \"remote branch that 'git pull' uses to update the current branch.\\n\"\n> -   \"\\n\"\n> -   \"See 'git help config' and search for 'push.default' for further \n> information.\\n\"\n> -   \"(the 'simple' mode was introduced in Git 1.7.11. Use the similar \n> mode\\n\"\n> -   \"'current' instead of 'simple' if you sometimes use older versions of \n> Git)\");\n> +   \"See 'git help config' and search for 'push.default' for further \n> information.\");\n>\n> static void warn_unspecified_push_default_configuration(void)\n> {\n>\n> --\n> https://github.com/git/git/pull/201\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n"},{"id":"279069","messageId":"vpqegc3f8bd.fsf@anie.imag.fr","threadId":"41485","inReplyTo":"A8668075C5244F34A8C21A22F91ED823@PhilipOakley","subject":"Re: [PATCH] push: shorten \"push.default is unset\" warning message","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-02-23T21:03:34Z","receivedAt":"2016-02-23T21:03:34Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"\"Philip Oakley\" <philipoakley@iee.org> writes:\n\n> Shouldn't this also update the 'push' man page to state what the new\n> default is. @gerry's comment to the top answer\n> http://stackoverflow.com/a/13148313/717355 highlights that the word\n> 'simple' is not even mentioned in the 'push' man page.\n\nThis is more or less a different topic IMHO. If git-push(1) is not clear\nenough, then it should be clarified regardless of this patch. But a\npatch follows.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"279071","messageId":"1456261481-23468-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"41485","inReplyTo":"vpqegc3f8bd.fsf@anie.imag.fr","subject":"[PATCH] Documentation/git-push: document that 'simple' is the default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-23T21:04:41Z","receivedAt":"2016-02-23T21:04:41Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The default behavior is well documented already in git-config(1), but\ngit-push(1) itself did not mention it at all. For users willing to learn\nhow \"git push\" works but not how to configure it, this makes the\ndocumentation cumbersome to read.\n\nMake the git-push(1) page self-contained by adding a short summary of\nwhat 'push.default=simple' does, early in the page.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/git-push.txt | 7 +++++++\n 1 file changed, 7 insertions(+)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 32482ce..a992793 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -37,6 +37,13 @@ the default `<refspec>` by consulting `remote.*.push` configuration,\n and if it is not found, honors `push.default` configuration to decide\n what to push (See linkgit:git-config[1] for the meaning of `push.default`).\n \n+When neither the command-line nor the configuration specify what to\n+push, the default behavior is used, which corresponds to the `simple`\n+value for `push.default`: the current branch is pushed to the\n+corresponding upstream branch, but as a safety measure, the push is\n+aborted if the upstream branch does not have the same name as the\n+local one.\n+\n \n OPTIONS[[OPTIONS]]\n ------------------\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279136","messageId":"20160224101115.GA20807@sigill.intra.peff.net","threadId":"41485","inReplyTo":"xmqqtwkz1c4b.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] push: shorten \"push.default is unset\" warning message","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-24T10:11:15Z","receivedAt":"2016-02-24T10:11:15Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 23, 2016 at 11:05:08AM -0800, Junio C Hamano wrote:\n\n> If most people are happy with \"simple\" (and certainly that was the\n> assumption and hope behind the transtion we made at 2.0), we may be\n> better off removing the warning altogether.  Keeping \"and adopt the\n> new behaviour\" part pretends to be offering a chance to make an\n> informed choice, but it will forever be unclear to the non-reader\n> what the implication of not adopting the new behaviour is anyway, so\n> overall we won't see reduced hits at stackoverflow with this change.\n\nYeah, this was my first thought on seeing Matthieu's patch. We inserted\nthat message to tell people about the impending change, and to catch any\nstragglers even after the change had happened. At some point it simply\nbecomes obsolete history.\n\nI dunno if that time is now or not. v2.3.0 (which actually flipped the\nswitch) is only a year old, but we've been showing the message since\nv1.8.0, which is over 3 years old. Even Debian stable is way beyond\nthat. :)\n\nSo my inclination is to just rip out the warning entirely.\n\n-Peff\n"},{"id":"279301","messageId":"1456392120-16298-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"41485","inReplyTo":"000001530ea408ed-2b71a34a-32bb-434c-bba5-fdac28193e9c-000000@eu-west-1.amazonses.com","subject":"[PATCH v2 0/2] Remove \"push.default unset\" warning","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-25T09:21:58Z","receivedAt":"2016-02-25T09:21:58Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Junio and Peff both lean towards removing the message completely, and\nI think I'm convinced. We would have to do this in the future anyway.\n\nWhile we're there, improve the manual for git push as suggested by\nPhilip Oakley.\n\nMatthieu Moy (2):\n  push: remove \"push.default is unset\" warning message\n  Documentation/git-push: document that 'simple' is the default\n\n Documentation/git-push.txt |  7 +++++++\n builtin/push.c             | 34 ----------------------------------\n 2 files changed, 7 insertions(+), 34 deletions(-)\n\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279302","messageId":"1456392120-16298-2-git-send-email-Matthieu.Moy@imag.fr","threadId":"41485","inReplyTo":"1456392120-16298-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 1/2] push: remove \"push.default is unset\" warning message","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-25T09:21:59Z","receivedAt":"2016-02-25T09:21:59Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The warning was important before the 2.0 transition, and remained\nimportant for a while after, so that new users get push.default\nexplicitly in their configuration and do not experience inconsistent\nbehavior if they ever used an older version of Git.\n\nThe warning has been there since version 1.8.0 (Oct 2012), hence we can\nexpect the vast majority of current Git users to have been exposed to\nit, and most of them have already set push.default explicitly. The\nswitch from 'matching' to 'simple' was planned for 2.0 (May 2014), but\nactually happened only for 2.3 (Feb 2015).\n\nToday, the warning is mostly seen by beginners, who have not set their\npush.default configuration (yet). For many of them, the warning is\nconfusing because it talks about concepts that they have not learned and\nasks them a choice that they are not able to make yet. See for example\n\n  http://stackoverflow.com/questions/13148066/warning-push-default-is-unset-its-implicit-value-is-changing-in-git-2-0\n\n(1260 votes for the question, 1824 for the answer as of writing)\n\nRemove the warning completely to avoid disturbing beginners. People who\nstill occasionally use an older version of Git will be exposed to the\nwarning through this old version.\n\nEventually, versions of Git without the warning will be deployed enough\nand tutorials will not need to advise setting push.default anymore.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n builtin/push.c | 34 ----------------------------------\n 1 file changed, 34 deletions(-)\n\ndiff --git a/builtin/push.c b/builtin/push.c\nindex 960ffc3..270db40 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -204,37 +204,6 @@ static void setup_push_current(struct remote *remote, struct branch *branch)\n \tadd_refspec(branch->name);\n }\n \n-static char warn_unspecified_push_default_msg[] =\n-N_(\"push.default is unset; its implicit value has changed in\\n\"\n-   \"Git 2.0 from 'matching' to 'simple'. To squelch this message\\n\"\n-   \"and maintain the traditional behavior, use:\\n\"\n-   \"\\n\"\n-   \"  git config --global push.default matching\\n\"\n-   \"\\n\"\n-   \"To squelch this message and adopt the new behavior now, use:\\n\"\n-   \"\\n\"\n-   \"  git config --global push.default simple\\n\"\n-   \"\\n\"\n-   \"When push.default is set to 'matching', git will push local branches\\n\"\n-   \"to the remote branches that already exist with the same name.\\n\"\n-   \"\\n\"\n-   \"Since Git 2.0, Git defaults to the more conservative 'simple'\\n\"\n-   \"behavior, which only pushes the current branch to the corresponding\\n\"\n-   \"remote branch that 'git pull' uses to update the current branch.\\n\"\n-   \"\\n\"\n-   \"See 'git help config' and search for 'push.default' for further information.\\n\"\n-   \"(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode\\n\"\n-   \"'current' instead of 'simple' if you sometimes use older versions of Git)\");\n-\n-static void warn_unspecified_push_default_configuration(void)\n-{\n-\tstatic int warn_once;\n-\n-\tif (warn_once++)\n-\t\treturn;\n-\twarning(\"%s\\n\", _(warn_unspecified_push_default_msg));\n-}\n-\n static int is_workflow_triangular(struct remote *remote)\n {\n \tstruct remote *fetch_remote = remote_get(NULL);\n@@ -253,9 +222,6 @@ static void setup_default_push_refspecs(struct remote *remote)\n \t\tbreak;\n \n \tcase PUSH_DEFAULT_UNSPECIFIED:\n-\t\twarn_unspecified_push_default_configuration();\n-\t\t/* fallthru */\n-\n \tcase PUSH_DEFAULT_SIMPLE:\n \t\tif (triangular)\n \t\t\tsetup_push_current(remote, branch);\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279303","messageId":"1456392120-16298-3-git-send-email-Matthieu.Moy@imag.fr","threadId":"41485","inReplyTo":"1456392120-16298-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 2/2] Documentation/git-push: document that 'simple' is the default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-25T09:22:00Z","receivedAt":"2016-02-25T09:22:00Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The default behavior is well documented already in git-config(1), but\ngit-push(1) itself did not mention it at all. For users willing to learn\nhow \"git push\" works but not how to configure it, this makes the\ndocumentation cumbersome to read.\n\nMake the git-push(1) page self-contained by adding a short summary of\nwhat 'push.default=simple' does, early in the page.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/git-push.txt | 7 +++++++\n 1 file changed, 7 insertions(+)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 32482ce..a992793 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -37,6 +37,13 @@ the default `<refspec>` by consulting `remote.*.push` configuration,\n and if it is not found, honors `push.default` configuration to decide\n what to push (See linkgit:git-config[1] for the meaning of `push.default`).\n \n+When neither the command-line nor the configuration specify what to\n+push, the default behavior is used, which corresponds to the `simple`\n+value for `push.default`: the current branch is pushed to the\n+corresponding upstream branch, but as a safety measure, the push is\n+aborted if the upstream branch does not have the same name as the\n+local one.\n+\n \n OPTIONS[[OPTIONS]]\n ------------------\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279512","messageId":"20160226105401.GA12472@sigill.intra.peff.net","threadId":"41485","inReplyTo":"1456392120-16298-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH v2 0/2] Remove \"push.default unset\" warning","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-26T10:54:01Z","receivedAt":"2016-02-26T10:54:01Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 25, 2016 at 10:21:58AM +0100, Matthieu Moy wrote:\n\n> Junio and Peff both lean towards removing the message completely, and\n> I think I'm convinced. We would have to do this in the future anyway.\n\nUnsurprisingly, this series looks good to me. :)\n\n-Peff\n"}]}