[1/1] fetch.c: fix typo in a warning message
diff mbox series

Message ID 70f10fe44716e50765a9d8f7794116f390f09dbc.1572554506.git.gitgitgadget@gmail.com
State New
Headers show
Series
  • fetch.c: fix typo in a warning message
Related show

Commit Message

Elijah Newren via GitGitGadget Oct. 31, 2019, 8:41 p.m. UTC
From: Ralf Thielow <ralf.thielow@gmail.com>

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
---
 builtin/fetch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Nieder Oct. 31, 2019, 10:53 p.m. UTC | #1
Ralf Thielow wrote:

> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
> ---
>  builtin/fetch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

> Noticed this while reviewing German translation.

This kind of context tends to be useful in a commit message --- it
helps clarify the motivation behind the change.

> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index 0c345b5dfe..f9a934f098 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -1411,7 +1411,7 @@ static int do_fetch(struct transport *transport,
>  		for (rm = ref_map; rm; rm = rm->next) {
>  			if (!rm->peer_ref) {
>  				if (source_ref) {
> -					warning(_("multiple branch detected, incompatible with --set-upstream"));
> +					warning(_("multiple branches detected, incompatible with --set-upstream"));

Long line.

I wonder what this warning is trying to say.  How would I go about
triggering this message?  The comment before says

	The relevant upstream is the fetched branch that is meant to
	be merged with the current one, i.e. the one fetched to
	FETCH_HEAD.

So is this about when I'm fetching with a wildcard or something?

Thanks,
Jonathan
Ralf Thielow Nov. 1, 2019, 9:48 a.m. UTC | #2
Am Do., 31. Okt. 2019 um 23:53 Uhr schrieb Jonathan Nieder <jrnieder@gmail.com>:
>
> I wonder what this warning is trying to say.  How would I go about
> triggering this message?  The comment before says
>
>         The relevant upstream is the fetched branch that is meant to
>         be merged with the current one, i.e. the one fetched to
>         FETCH_HEAD.
>
> So is this about when I'm fetching with a wildcard or something?
>

The message shows up when multiple refspecs/branches are passed,
like

$ git fetch --set-upstream origin master next
From https://github.com/git/git
 * branch                  master     -> FETCH_HEAD
 * branch                  next       -> FETCH_HEAD
warning: multiple branch detected, incompatible with --set-upstream
Junio C Hamano Nov. 2, 2019, 5:50 a.m. UTC | #3
Jonathan Nieder <jrnieder@gmail.com> writes:

> Ralf Thielow wrote:
>
>> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
>> ---
>>  builtin/fetch.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
>>  				if (source_ref) {
>> -					warning(_("multiple branch detected, incompatible with --set-upstream"));
>> +					warning(_("multiple branches detected, incompatible with --set-upstream"));
>
> Long line.


Thanks, both.  This close to the final, I am reluctant to touch any
string inside _(), so let's postpone it to the next cycle, though.

Patch
diff mbox series

diff --git a/builtin/fetch.c b/builtin/fetch.c
index 0c345b5dfe..f9a934f098 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1411,7 +1411,7 @@  static int do_fetch(struct transport *transport,
 		for (rm = ref_map; rm; rm = rm->next) {
 			if (!rm->peer_ref) {
 				if (source_ref) {
-					warning(_("multiple branch detected, incompatible with --set-upstream"));
+					warning(_("multiple branches detected, incompatible with --set-upstream"));
 					goto skip;
 				} else {
 					source_ref = rm;