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

Re: [PATCH] Make sure the diff machinery outputs "\ No newline ..." in english

From
Fredrik Kuivinen <freku045@student.liu.se>
Date
Sep 5, 2005, 06:01 UTC
Message-ID
<20050905060149.GB1875@c165.ib.student.liu.se>
In-Reply-To
<7vd5nohdp3.fsf@assigned-by-dhcp.cox.net>
On Sun, Sep 04, 2005 at 11:48:08AM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> Fredrik Kuivinen <freku045@student.liu.se> writes:
> 
> > In non-english locales diff(1) do sometimes output "\ No newline at end of
> > file" in some other language. Set LC_ALL to C before execing diff to avoid
> > this behaviour.
> >
> > Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
> 
> I was thinking about this when I was examining your other patch.
> 
> What else, other than the incomplete line marker (and timestamp
> output it uses by default, which we disable by passing explicit
> -L flags), are affected by locale in diff output?

After a quick look through the diff source I didn't find anything else. It's quite possible that I haved missed something though. Most of the translated messages are related to error reporting, which I guess might be nice to have in the user specified language.

Show 11 quoted lines
> Especially, if the diff output is more readable for human
> consumers (i.e. reviewers) without making it harder to use to
> machine consumers (i.e. patch or git-apply) when generated under
> a locale that is 'native' to the data, this patch robs from
> users the possibility of doing so.
> 
> IOW, in a Swedes-only project that tracks a document in Swedish,
> it _might_ be friendlier and more useful to the users if allowed
> generating diffs under sv_SE locale, as long as such a diff does
> not make the processing by patch and git-apply more difficult
> (which your other patch already solved for git-apply).

I agree that it's kind of evil to remove the option of generating the output in some other language.

Another possibility is to set LC_MESSAGES to C instead. If we go this way the user can override it by setting LC_ALL. The difference is that in most configurations the user has to make an active choice to get the 'native' language output and english will be the default.

- Fredrik
Previous: Junio C HamanoNext: Linus Torvalds
Message 3 of 5 in “Make sure the diff machinery outputs "\ No newline ..." in english”
  1. Make sure the diff machinery outputs "\ No newline ..." in englishFredrik Kuivinen, Sep 4, 2005
  2. Junio C HamanoSep 4, 2005
  3. Fredrik KuivinenSep 5, 2005
  4. Linus TorvaldsSep 5, 2005
  5. Daniel BarkalowSep 6, 2005

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.