All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: XANi <xani666@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [BUG] Veryfing signatures in git log fails when language is not english
Date: Thu, 14 Feb 2013 11:55:04 +0100	[thread overview]
Message-ID: <511CC288.30607@drmicha.warpmail.net> (raw)
In-Reply-To: <20130214011837.04880b3e@hydra.devrandom.pl>

XANi venit, vidit, dixit 14.02.2013 01:18:
> 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

  reply	other threads:[~2013-02-14 10:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14  0:18 [BUG] Veryfing signatures in git log fails when language is not english XANi
2013-02-14 10:55 ` Michael J Gruber [this message]
2013-02-14 12:42   ` Mariusz Gronczewski
2013-02-14 16:04     ` [PATCH 0/5] gpg_interface: use the status Michael J Gruber
2013-02-14 16:04       ` [PATCH 1/5] gpg-interface: check good signature in a reliable way Michael J Gruber
2013-02-14 17:22         ` Junio C Hamano
2013-02-15  8:27           ` Michael J Gruber
2013-02-14 16:04       ` [PATCH 2/5] log-tree: rely upon the check in the gpg_interface Michael J Gruber
2013-02-14 16:04       ` [PATCH 3/5] gpg_interface: allow to request status return Michael J Gruber
2013-02-14 16:04       ` [PATCH 4/5] pretty: parse the gpg status lines rather than the output Michael J Gruber
2013-02-14 16:04       ` [PATCH 5/5] pretty: make %GK output the signing key for signed commits Michael J Gruber
2013-02-14 16:47     ` [BUG] Veryfing signatures in git log fails when language is not english Junio C Hamano
2013-02-15 14:14       ` Mariusz Gronczewski
2013-02-15 16:08         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=511CC288.30607@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=xani666@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.