# [PATCH] push: Enhance unspecified push default warning

3 messages from 2013-10-02 to 2013-10-03. Participants: Coder Coder5000, Duy Nguyen, Matthieu Moy.
Thread: https://gitlist.dev/t/35054

## Coder Coder5000, 2013-10-02 20:48

Subject: [PATCH] push: Enhance unspecified push default warning
Message-ID: <CAKYC+eLGS6ocdE7CTV25E2xMRaHijmQbFBc3tAyx3cNpXfC_sg@mail.gmail.com>
URL: https://gitlist.dev/e/CAKYC%2BeLGS6ocdE7CTV25E2xMRaHijmQbFBc3tAyx3cNpXfC_sg%40mail.gmail.com

```
When the unset push.default warning message is displayed
this may be the first time many users encounter push.default.
Modified the warning message to explain in a compact
manner what push.default is and why it is being changed in
Git 2.0.  Also provided additional information to help users
decide if this change will affect their workflow.

Signed-off-by: Greg Jacobson <coder5000@gmail.com>
---
 builtin/push.c | 9 +++++++++
 po/git.pot     | 8 ++++++++
 2 files changed, 17 insertions(+)

diff --git a/builtin/push.c b/builtin/push.c
index 7b1b66c..eb7a721 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -174,6 +174,15 @@ N_("push.default is unset; its implicit value is
changing in\n"
    "\n"
    "  git config --global push.default simple\n"
    "\n"
+   "When push.default is set to matching git will push all local branches\n"
+   "to the remote branches with the same (matching) name.  This will no\n"
+   "longer be the default in Git 2.0 because a branch could be\n"
+   "unintentionally pushed to a remote.\n"
+   "\n"
+   "In Git 2.0 the new push.default of simple will push only the current\n"
+   "branch to the same remote branch used by git pull.   A push will\n"
+   "only succeed if the remote and local branches have the same name.\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)");
diff --git a/po/git.pot b/po/git.pot
index c91e197..6025a54 100644
--- a/po/git.pot
+++ b/po/git.pot
@@ -7240,6 +7240,14 @@ msgid ""
 "\n"
 "  git config --global push.default simple\n"
 "\n"
+"When push.default is set to matching git will push all local branches\n"
+"to the remote branches with the same (matching) name.  This will no\n"
+"longer be the default in Git 2.0 because a branch could be\n"
+"unintentionally pushed to a remote.\n"
+"\n"
+"In Git 2.0 the new push.default of simple will push only the current\n"
+"branch to the same remote branch used by git pull.   A push will\n"
+"only succeed if the remote and local branches have the same name.\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"
-- 
1.8.4.474.g128a96c.dirty

```

## Duy Nguyen, 2013-10-03 00:57

Subject: Re: [PATCH] push: Enhance unspecified push default warning
Message-ID: <CACsJy8Bt_mtXVHjWn+8Ba6qrk=vSh2kGyaowA9B+=2xvhA_o_g@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8Bt_mtXVHjWn%2B8Ba6qrk%3DvSh2kGyaowA9B%2B%3D2xvhA_o_g%40mail.gmail.com
In-Reply-To: <CAKYC+eLGS6ocdE7CTV25E2xMRaHijmQbFBc3tAyx3cNpXfC_sg@mail.gmail.com>

```
On Thu, Oct 3, 2013 at 3:48 AM, Coder Coder5000 <coder5000@gmail.com> wrote:
> When the unset push.default warning message is displayed
> this may be the first time many users encounter push.default.
> Modified the warning message to explain in a compact
> manner what push.default is and why it is being changed in
> Git 2.0.  Also provided additional information to help users
> decide if this change will affect their workflow.
>
> Signed-off-by: Greg Jacobson <coder5000@gmail.com>
> ---
>  builtin/push.c | 9 +++++++++
>  po/git.pot     | 8 ++++++++
>  2 files changed, 17 insertions(+)

You don't have to update git.pot. It'll be regenerated regularly by Jiang Xin.
-- 
Duy

```

## Matthieu Moy, 2013-10-03 06:48

Subject: Re: [PATCH] push: Enhance unspecified push default warning
Message-ID: <vpqr4c2kfyh.fsf@anie.imag.fr>
URL: https://gitlist.dev/e/vpqr4c2kfyh.fsf%40anie.imag.fr
In-Reply-To: <CAKYC+eLGS6ocdE7CTV25E2xMRaHijmQbFBc3tAyx3cNpXfC_sg@mail.gmail.com>

```
Coder Coder5000 <coder5000@gmail.com> writes:
^^^^^^^^^^^^^^^
Please, use your real identity in your From: field (git send-email may
help).

> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -174,6 +174,15 @@ N_("push.default is unset; its implicit value is
> changing in\n"
>     "\n"
>     "  git config --global push.default simple\n"
>     "\n"
> +   "When push.default is set to matching git will push all local branches\n"
> +   "to the remote branches with the same (matching) name.  This will no\n"
> +   "longer be the default in Git 2.0 because a branch could be\n"
> +   "unintentionally pushed to a remote.\n"
> +   "\n"
> +   "In Git 2.0 the new push.default of simple will push only the current\n"
> +   "branch to the same remote branch used by git pull.   A push will\n"
> +   "only succeed if the remote and local branches have the same name.\n"
> +   "\n"

It is becoming a monster-warning, but I think this is a good change.
People who still see the warning are those who did not upgrade for a
while (and therefore probably the ones needing the most explanation).
And it's meant to be a one-time warning anyway.

Judging by the question asked on stackoverflow
( http://stackoverflow.com/questions/13148066/warning-push-default-is-unset-its-implicit-value-is-changing-in-git-2-0 )
and its popularity, telling the users to read the docs did not work very
well.

Thanks,

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```
