diff mbox series

[v3,2/8] send-pack/transport-helper: avoid mentioning a particular branch

Message ID a29943d7bbc11a524089348a4abbd33c7514eee9.1592951611.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Allow overriding the default name of the default branch | expand

Commit Message

Linus Arver via GitGitGadget June 23, 2020, 10:33 p.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

When trying to push all matching branches, but none match, we offer a
message suggesting to push the `master` branch.

However, we want to step away from making that branch any more special
than any other branch, so let's reword that message to mention no branch
in particular.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 send-pack.c             | 2 +-
 t/t5528-push-default.sh | 6 ++++++
 transport-helper.c      | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

Comments

Junio C Hamano June 24, 2020, 12:36 a.m. UTC | #1
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> @@ -1046,7 +1046,7 @@ static int push_refs(struct transport *transport,
>  	if (!remote_refs) {
>  		fprintf(stderr,
>  			_("No refs in common and none specified; doing nothing.\n"
> -			  "Perhaps you should specify a branch such as 'master'.\n"));
> +			  "Perhaps you should specify a specific branch.\n"));

Hmph, not just "specify a branch."?  Maybe it is just me, but
"specify a specific branch" did not roll well on my tongue.
Johannes Schindelin June 24, 2020, 12:44 p.m. UTC | #2
Hi Junio,

On Tue, 23 Jun 2020, Junio C Hamano wrote:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > @@ -1046,7 +1046,7 @@ static int push_refs(struct transport *transport,
> >  	if (!remote_refs) {
> >  		fprintf(stderr,
> >  			_("No refs in common and none specified; doing nothing.\n"
> > -			  "Perhaps you should specify a branch such as 'master'.\n"));
> > +			  "Perhaps you should specify a specific branch.\n"));
>
> Hmph, not just "specify a branch."?  Maybe it is just me, but
> "specify a specific branch" did not roll well on my tongue.

Oh well. "Perhaps you should specify a branch" sounded too judgmental to
me, but I'm not a native speaker, so I simply removed the word "specific".

Ciao,
Dscho
Junio C Hamano June 24, 2020, 3:44 p.m. UTC | #3
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi Junio,
>
> On Tue, 23 Jun 2020, Junio C Hamano wrote:
>
>> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
>> writes:
>>
>> > @@ -1046,7 +1046,7 @@ static int push_refs(struct transport *transport,
>> >  	if (!remote_refs) {
>> >  		fprintf(stderr,
>> >  			_("No refs in common and none specified; doing nothing.\n"
>> > -			  "Perhaps you should specify a branch such as 'master'.\n"));
>> > +			  "Perhaps you should specify a specific branch.\n"));
>>
>> Hmph, not just "specify a branch."?  Maybe it is just me, but
>> "specify a specific branch" did not roll well on my tongue.
>
> Oh well. "Perhaps you should specify a branch" sounded too judgmental to
> me, but I'm not a native speaker, so I simply removed the word "specific".

I'm not either.  Note that when I say "maybe it is just me", I
usually am not asking to change anything.
Johannes Schindelin June 25, 2020, 1:05 p.m. UTC | #4
Hi Junio,

On Wed, 24 Jun 2020, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > On Tue, 23 Jun 2020, Junio C Hamano wrote:
> >
> >> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> >> writes:
> >>
> >> > @@ -1046,7 +1046,7 @@ static int push_refs(struct transport *transport,
> >> >  	if (!remote_refs) {
> >> >  		fprintf(stderr,
> >> >  			_("No refs in common and none specified; doing nothing.\n"
> >> > -			  "Perhaps you should specify a branch such as 'master'.\n"));
> >> > +			  "Perhaps you should specify a specific branch.\n"));
> >>
> >> Hmph, not just "specify a branch."?  Maybe it is just me, but
> >> "specify a specific branch" did not roll well on my tongue.
> >
> > Oh well. "Perhaps you should specify a branch" sounded too judgmental to
> > me, but I'm not a native speaker, so I simply removed the word "specific".
>
> I'm not either.

We should start a society or something ;-)

> Note that when I say "maybe it is just me", I usually am not asking to
> change anything.

Of course! In this instance, your suggestion made me think and prefer the
non-repetitive version (because let's face it, taking out that word did
not make it any more or less judgemental).

Ciao,
Dscho
diff mbox series

Patch

diff --git a/send-pack.c b/send-pack.c
index 0abee22283..db79cdac77 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -406,7 +406,7 @@  int send_pack(struct send_pack_args *args,
 
 	if (!remote_refs) {
 		fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
-			"Perhaps you should specify a branch such as 'master'.\n");
+			"Perhaps you should specify a specific branch.\n");
 		return 0;
 	}
 	if (args->atomic && !atomic_supported)
diff --git a/t/t5528-push-default.sh b/t/t5528-push-default.sh
index 4d1e0c363e..68b84c4add 100755
--- a/t/t5528-push-default.sh
+++ b/t/t5528-push-default.sh
@@ -98,6 +98,12 @@  test_expect_success 'push from/to new branch with upstream, matching and simple'
 	test_push_failure upstream
 '
 
+test_expect_success '"matching" fails if none match' '
+	git init --bare empty &&
+	test_must_fail git push empty : 2>actual &&
+	test_i18ngrep "Perhaps you should specify a specific branch" actual
+'
+
 test_expect_success 'push ambiguously named branch with upstream, matching and simple' '
 	git checkout -b ambiguous &&
 	test_config branch.ambiguous.remote parent1 &&
diff --git a/transport-helper.c b/transport-helper.c
index a46afcb69d..b81a3486bd 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -1046,7 +1046,7 @@  static int push_refs(struct transport *transport,
 	if (!remote_refs) {
 		fprintf(stderr,
 			_("No refs in common and none specified; doing nothing.\n"
-			  "Perhaps you should specify a branch such as 'master'.\n"));
+			  "Perhaps you should specify a specific branch.\n"));
 		return 0;
 	}