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

Re: [BUG] Veryfing signatures in git log fails when language is not english

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Feb 14, 2013, 10:55 UTC
Message-ID
<511CC288.30607@drmicha.warpmail.net>
In-Reply-To
<20130214011837.04880b3e@hydra.devrandom.pl>
XANi venit, vidit, dixit 14.02.2013 01:18:
Show 21 quoted lines
> Hi,
> 
> any functionality that depends on exact exit msg of program
>  can potentially fail because of that
> ᛯ export |grep LANG
> declare -x LANG="pl_PL.UTF-8"
> 
> ᛯ ~/src/os/git/git log --format="%G? %h" |head -2 
>  0d19377
>  5b9d7f8
> 
> ᛯ unset LANG
> ᛯ ~/src/os/git/git log --format="%G? %h" |head -2
> G 0d19377
> G 5b9d7f8
> 
> tested against maint (d32805d) and master (5bf72ed)
> 
> maybe git should set up some output-changing variables before calling
> external programs? I think setting LC_ALL=C should be enougth.
> 
There are really multiple problems here:
1. git calls gpg without setting LANG but expects output in LANG=C
2. git looks at the textual output from gpg to check the validity.
3. In fact, it does so only for %G and the display of signed merge
commits, in all other cases it checks the return code only.
gpg is not supposed to be used like that.

Since the callers of verify_signed_buffer do that craziness there is some refactoring to be done.

A false hotfix would be to set LANG=C when calling gpg from git, but that wouldn't solve the real problem. Besides, we do want LANG dependent output for the user.

I'll have a closer look.
BTW: Thanks for the clear report :)
Michael
Previous: XANiNext: Mariusz Gronczewski
Message 2 of 14 in “[BUG] Veryfing signatures in git log fails when language is not english”
  1. XANiFeb 14, 2013
  2. Michael J GruberFeb 14, 2013
  3. Mariusz GronczewskiFeb 14, 2013
  4. 0/5 gpg_interface: use the statusMichael J Gruber, Feb 14, 2013
  5. 1/5 gpg-interface: check good signature in a reliable wayMichael J Gruber, Feb 14, 2013
  6. Junio C HamanoFeb 14, 2013
  7. Michael J GruberFeb 15, 2013
  8. 2/5 log-tree: rely upon the check in the gpg_interfaceMichael J Gruber, Feb 14, 2013
  9. 3/5 gpg_interface: allow to request status returnMichael J Gruber, Feb 14, 2013
  10. 4/5 pretty: parse the gpg status lines rather than the outputMichael J Gruber, Feb 14, 2013
  11. 5/5 pretty: make %GK output the signing key for signed commitsMichael J Gruber, Feb 14, 2013
  12. Junio C HamanoFeb 14, 2013
  13. Mariusz GronczewskiFeb 15, 2013
  14. Junio C HamanoFeb 15, 2013

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.