Subject: Re: [PATCH v8 07/15] bugreport: add git-remote-https version

From: Emily Shaffer <[email-masked]>
Date: Tue, 25 Feb 2020 14:08:38 -0800

On Thu, Feb 20, 2020 at 07:44:30PM -0800, Junio C Hamano wrote:
> Emily Shaffer <[email-masked]> writes:
> 
> > ... Unfortunately I agree that we wouldn't be equipped to handle
> > reports in other languages.
> 
> I actually was anticipating a far better world ;-) 
> 
> There is no reason to limit the recipient of reports only to *us*.
> Use of Git and population proficient in Git would become wide enough
> that we should be able to expect that users who speak language X can
> be helped by experts who speak the same language X with their
> issues.

Hm. I guess I got the opposite impression from you way back in v1. I do
wish it had been communicated a little more clearly; it's frustrating to
perceive a reversal after seven months of review. But that's probably on
my own reading comprehension :)

Well, I certainly don't mind - but I did have a pretty long conversation
with Jonathan Nieder last week about whether it's feasible to make the
bugreport extremely stable while also being locale aware. As I
understood it, he worried about someone having a misconfigured locale
causing the bugreport tool to crash when it tries to set the locale.

But I'm having trouble figuring out how that can happen. It looks like
we use libintl.h to do almost all of our string localization, which I
have to assume is pretty robust. Or to put it another way, if the user's
environment has broken libintl.h, then it seems like they also have
bigger problems outside of Git which they would notice already.

(Side note: I went down a rabbit hole of trying to break my locale, and
did manage to generate some garbage by setting 'LANG' to a non-UTF-8
character set and setting 'LANGUAGE' to a character set which does
require UTF-8, that is, 'LANG=es_MX LANGUAGE=ko git status'.)

How about if I localize the bugreport template, headers, and formatted
comments (e.g. "3745 local loose objects"), and include a tip in 'git
help bugreport' suggesting that if it doesn't look right, maybe the user
wants to run it with 'LANG= LANGUAGE= git bugreport' to ensure it
actually gets generated?

I had another thought, actually, that this is maybe semantically similar
problem to the malformed config we discussed earlier in the review. Does
it make sense to include some kind of --safemode flag to 'git' which
asks it to not perform localization and not read configs? I would
propose adding it just to git-bugreport, and I could work around some
locale weirdness that way, but with a broken config the attempt dies
before git-bugreport binary is invoked at all.

 - Emily