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

Re: [PATCH] fixed translation in config file to enhance user output message from the porcelain command(git config). This fixes the error and die function by wrapping it in the _(...) function. This also avoid the code from breaking

From
Junio C Hamano <gitster@pobox.com>
Date
May 6, 2015, 19:23 UTC
Message-ID
<xmqqoalxtsq9.fsf@gitster.dls.corp.google.com>
In-Reply-To
<554a6462.c2bbb40a.1e2a.0255@mx.google.com>
Alangi Derick <alangiderick@gmail.com> writes:
>> Cc: unlisted-recipients:; (no To-header on input)
The comments in $gmane/268330 still applies to this one.
    It seems you are posting putting the list in Bcc. Don't do that:
    it makes it painful to reply to your message (I had to re-add
    git@vger manually).
>> Subject: Re: [PATCH] fixed translation in config file to enhance user output message from the porcelain command(git config). This fixes the error and die function by wrapping it in the _(...) function. This also avoid the code from breaking

The first paragraph of your commit message becomes the patch title and conveyed on the "Subject:" line. So

 (1) Keep the first paragraph to one single line.
 (2) Keep the length of that line short and to the point.
Also the comments in $gmane/268335 still applies to this one.

SubmittingPatches prefers to see an "<area>:" prefix so that output of "git shortlog --no-merges -100" would give the readers a better overview of the changes.

When "fix a translation error in config file..." appears among 100 other commits in "git shortlog" output, what kind of change would a reader imagine this to be, though?

My answer to that question would be: "There was an existing translation in 'git config' output, that was incorrect in some unspecified way, and this change corrects that breakage."

And that is not what is going on, so the change is mistitled.
Perhaps
    config.c: mark error strings for translation

or something, modelling after 8262aaa2 (config.c: mark error and warnings strings for translation, 2014-08-07), may be more appropriate. Personally, I do not think the log message for this change needs anything more than that title.

Show 15 quoted lines
> Signed-off-by: Alangi Derick <alangiderick@gmail.com>
> ---
>  config.c | 46 +++++++++++++++++++++++-----------------------
>  1 file changed, 23 insertions(+), 23 deletions(-)
>
> diff --git a/config.c b/config.c
> index 66c0a51..cc41dbb 100644
> --- a/config.c
> +++ b/config.c
> @@ -76,7 +76,7 @@ static int config_buf_ungetc(int c, struct config_source *conf)
>  	if (conf->u.buf.pos > 0) {
>  		conf->u.buf.pos--;
>  		if (conf->u.buf.buf[conf->u.buf.pos] != c)
> -			die("BUG: config_buf can only ungetc the same character");
> +			die(_("BUG: config_buf can only ungetc the same character"));
I do not think this change is a good idea.
Comments in $gmane/268373 still applies to this version.

"BUG:" is a sign that we encountered an unexpected condition, and untranslated message is much easier for Git developers to spot where it came from.

> @@ -976,8 +976,8 @@ static int git_default_push_config(const char *var, const char *value)
>  			push_default = PUSH_DEFAULT_CURRENT;
>  		else {
>  			error("Malformed value for %s: %s", var, value);
Why not this one?
Show 7 quoted lines
> -			return error("Must be one of nothing, matching, simple, "
> -				     "upstream or current.");
> +			return error(_("Must be one of nothing, matching, simple, "
> +				     "upstream or current."));
>  		}
>  		return 0;
>  	}
Previous: Alangi DerickNext: Stefan Beller
Message 2 of 5 in “fixed translation in config file to enhance user output message from the porcelain command(git config). This fixes the error and die function by wrapping it in the _(...) function. This also avoid the code from breaking”
  1. fixed translation in config file to enhance user output message from the porcelain command(git config). This fixes the error and die function by wrapping it in the _(...) function. This also avoid the code from breakingAlangi Derick, May 6, 2015
  2. Junio C HamanoMay 6, 2015
  3. Stefan BellerMay 6, 2015
  4. Alangi DerickMay 6, 2015
  5. Junio C HamanoMay 6, 2015

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.