git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] push: shorten "push.default is unset" warning message

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 23, 2016, 19:05 UTC
Message-ID
<xmqqtwkz1c4b.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<000001530ea408ed-2b71a34a-32bb-434c-bba5-fdac28193e9c-000000@eu-west-1.amazonses.com>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 8 quoted lines
> The warning is mostly seen by beginners, who have not set their
> push.default configuration (yet). For many of them, the warning is
> confusing because it talks about concepts that they have not learned and
> asks them a choice that they are not able to make yet. See for example
>
>   http://stackoverflow.com/questions/13148066/warning-push-default-is-unset-its-implicit-value-is-changing-in-git-2-0
>
> (1260 votes for the question, 1824 for the answer as of writing)
The punchline of that question is:
    I can obviously set it to one of the values mentioned, but what do
    they mean? What's the difference between simple and matching?

It tells us that "See 'git help config'" is not such an effective message to help such a user.

> Shorten the warning and mention only the way to remove the warning
> without changing the behavior. Keep a pointer to the documentation so
> that people willing to learn can still find the alternative behaviors
> easily.

While I admit that I usually am the most cautious one when dealing with any change, I am not sure if this rephrasing helps very much. As we saw, the sentence you kept, "See 'git help config'", is not effective in helping those stackoverflow users. Removal of the other parts of the message the patch does does make sense, as we know these users do not read, so they are merely noisy black pixels on the screen.

If most people are happy with "simple" (and certainly that was the assumption and hope behind the transtion we made at 2.0), we may be better off removing the warning altogether. Keeping "and adopt the new behaviour" part pretends to be offering a chance to make an informed choice, but it will forever be unclear to the non-reader what the implication of not adopting the new behaviour is anyway, so overall we won't see reduced hits at stackoverflow with this change.

After all, push.default configuration is hardly the only case where there are other ways to use Git that may match the user's situation better, and we do not advertise "Oh by the way you can do things differently, study the manual" for any of them with a warning message like this. Those who want to do different things know to seek settings to tweak.

The above analysis considers _only_ those who go to stackoverflow. For those who do read, perhaps "See 'git config help'" may have some value, but again, many aspects of the system can be tweaked, and we do not advertise that everywhere, so...

> Eventually, the warning should be removed completely, but this can wait
> a couple more releases or years.
Show 42 quoted lines
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
>  builtin/push.c | 20 +++-----------------
>  1 file changed, 3 insertions(+), 17 deletions(-)
>
> diff --git a/builtin/push.c b/builtin/push.c
> index 960ffc3..00eba2f 100644
> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -205,26 +205,12 @@ static void setup_push_current(struct remote *remote, struct branch *branch)
>  }
>  
>  static char warn_unspecified_push_default_msg[] =
> -N_("push.default is unset; its implicit value has changed in\n"
> -   "Git 2.0 from 'matching' to 'simple'. To squelch this message\n"
> -   "and maintain the traditional behavior, use:\n"
> -   "\n"
> -   "  git config --global push.default matching\n"
> -   "\n"
> -   "To squelch this message and adopt the new behavior now, use:\n"
> +N_("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"
>     "\n"
> -   "When push.default is set to 'matching', git will push local branches\n"
> -   "to the remote branches that already exist with the same name.\n"
> -   "\n"
> -   "Since Git 2.0, Git defaults to the more conservative 'simple'\n"
> -   "behavior, which only pushes the current branch to the corresponding\n"
> -   "remote branch that 'git pull' uses to update the current branch.\n"
> -   "\n"
> -   "See 'git help config' and search for 'push.default' for further information.\n"
> -   "(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode\n"
> -   "'current' instead of 'simple' if you sometimes use older versions of Git)");
> +   "See 'git help config' and search for 'push.default' for further information.");
>  
>  static void warn_unspecified_push_default_configuration(void)
>  {
>
> --
> https://github.com/git/git/pull/201
Previous: Matthieu MoyNext: Matthieu Moy
Message 2 of 11 in “push: shorten "push.default is unset" warning message”
  1. push: shorten "push.default is unset" warning messageMatthieu Moy, Feb 23, 2016
  2. Junio C HamanoFeb 23, 2016
  3. Matthieu MoyFeb 23, 2016
  4. Jeff KingFeb 24, 2016
  5. Philip OakleyFeb 23, 2016
  6. Matthieu MoyFeb 23, 2016
  7. Documentation/git-push: document that 'simple' is the defaultMatthieu Moy, Feb 23, 2016
  8. 0/2 Remove "push.default unset" warningMatthieu Moy, Feb 25, 2016
  9. 1/2 push: remove "push.default is unset" warning messageMatthieu Moy, Feb 25, 2016
  10. 2/2 Documentation/git-push: document that 'simple' is the defaultMatthieu Moy, Feb 25, 2016
  11. Jeff KingFeb 26, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.