gex icon indicating copy to clipboard operation
gex copied to clipboard

gex command fails when LANG=ja_JP.UTF-8 (maybe other non-english locales as well)

Open oshikiri opened this issue 3 years ago • 4 comments

Hi, I usually launch emacs only for magit, so I am interested in gex

gex command fails when the locale is non-English:

$ gex --version
gex 0.3.2

$ echo $LANG
ja_JP.UTF-8

$ gex
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Error { input: "ブランチ master", code: Tag })', /home/<username>/.cargo/registry/src/github.com-1ecc6299db9ec823/gex-0.3.2/src/status.rs:307:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

$ LANG=en_US gex
# it works

It may be because git status's result changes depending on locale:

$ LANG=en_US git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

$ echo $LANG
ja_JP.UTF-8

$ git status
ブランチ master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

(ブランチ means "branch" in japanese)

and gex uses git status at https://github.com/Piturnah/gex/blob/v0.3.2/src/status.rs#L299-L307

oshikiri avatar Aug 22 '22 15:08 oshikiri

Hello @oshikiri and @poliorcetics.

This issue should be fixed in the latest commit. If either of you are able to, please try it out with

$ cargo install --git https://github.com/Piturnah/gex

and let me know if it resolves your issue.

Thanks!

Piturnah avatar Aug 30 '22 10:08 Piturnah

I'm unable to check for myself right now, but it's just occurred to me that actually what you'll probably get is it won't crash but it also won't display any diffs. This is going to take more work to resolve than I initially thought.

Piturnah avatar Aug 30 '22 10:08 Piturnah

Thank you for update!

After updating gex to 0.3.4-dev, gex command does not show thread 'main' panicked ... and properly launched in my environment :+1:

oshikiri avatar Aug 30 '22 11:08 oshikiri

No crash anywhere but you're right, it doesn't get the changes:

Modified file:

	modifié :         deny.toml

gex outputs:

nothing to commit, working tree clean

poliorcetics avatar Aug 30 '22 12:08 poliorcetics