Subject: Re: [PATCH v3] git-merge: rewrite already up to date message

From: Junio C Hamano <[email-masked]>
Date: Wed, 28 Apr 2021 13:04:32 +0900

"Josh Soref via GitGitGadget" <[email-masked]> writes:

> From: Josh Soref <[email-masked]>
>
> Usually, it is easier to read a message if it makes its primary
> point first, before giving a parenthetical note.
>
> Possible messages before include:
> ` (nothing to squash)Already up to date.
> `
> and
> `Already up to date. Yeeah!
> `
>
> After:
> `Already up to date (nothing to squash).
> `
> and
> `Already up to date.
> `
>
> Localizations now have two easy to understand translatable strings.
> (All localizations of the previous strings are broken.)
>
> Co-authored-by: Eric Sunshine <[email-masked]>
> Signed-off-by: Josh Soref <[email-masked]>
> ---

I am not sure why this is Co-au, and not the more usual "Helped-by".

The patch text makes sense to me.

Thanks.

> diff --git a/builtin/merge.c b/builtin/merge.c
> index 062e91144125..f8c3d0687eaf 100644
> --- a/builtin/merge.c
> +++ b/builtin/merge.c
> @@ -380,10 +380,14 @@ static void restore_state(const struct object_id *head,
>  }
>  
>  /* This is called when no merge was necessary. */
> -static void finish_up_to_date(const char *msg)
> +static void finish_up_to_date(void)
>  {
> -	if (verbosity >= 0)
> -		printf("%s%s\n", squash ? _(" (nothing to squash)") : "", msg);
> +	if (verbosity >= 0) {
> +		if (squash)
> +			puts(_("Already up to date (nothing to squash)."));
> +		else
> +			puts(_("Already up to date."));
> +	}
>  	remove_merge_branch_state(the_repository);
>  }
>  
> @@ -1482,7 +1486,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
>  		 * If head can reach all the merge then we are up to date.
>  		 * but first the most common case of merging one remote.
>  		 */
> -		finish_up_to_date(_("Already up to date."));
> +		finish_up_to_date();
>  		goto done;
>  	} else if (fast_forward != FF_NO && !remoteheads->next &&
>  			!common->next &&
> @@ -1566,7 +1570,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
>  			}
>  		}
>  		if (up_to_date) {
> -			finish_up_to_date(_("Already up to date. Yeeah!"));
> +			finish_up_to_date();
>  			goto done;
>  		}
>  	}
>
> base-commit: 7a6a90c6ec48fc78c83d7090d6c1b95d8f3739c0