Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/review: go-codereview tool does not work with non-English locales #33895

Closed
ericlagergren opened this issue Aug 28, 2019 · 5 comments
Closed
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@ericlagergren
Copy link
Contributor

go env Output
$ go env
GOARCH="amd64"
GOBIN="/Users/ericlagergren/gopath/bin"
GOCACHE="/Users/ericlagergren/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ericlagergren/gopath"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/ericlagergren/go/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/vp/6n5tkzt93_7cb22vrc0qd08r0000gn/T/go-build083691314=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

  1. Installed the git-codereview tool.
  2. Cloned https://go.googlesource.com/go
  3. Checked out a branch
  4. Added my changes
  5. Tried to run git codereview change

What did you expect to see?

It work like it did when my machine was in English.

What did you see instead?

It failed.

$ git change
git rev-parse --abbrev-ref issue33792@{u}
fatal: aucune branche amont configurée pour la branche 'issue33792'

/Users/ericlagergren/gopath/bin/git-codereview: exit status 128

I'm assuming this is because the OriginBranch function checks for the English output, "upstream configured," not the French "aucune branche amont configurée." (https://github.com/golang/review/blob/3faf27076323fb8383c9b24e875f37a630b2f213/git-codereview/branch.go#L88)

It works if I run LANG=en_US git change. I'm assuming i18n is too big of a task, so it'd be nice if the tool could at least notice when it won't be able to parse strings and provide a decent error message.

@ericlagergren ericlagergren changed the title review: tool does not work with non-English locales review: go-codereview tool does not work with non-English locales Aug 28, 2019
@agnivade agnivade changed the title review: go-codereview tool does not work with non-English locales x/review: go-codereview tool does not work with non-English locales Aug 28, 2019
@gopherbot gopherbot added this to the Unreleased milestone Aug 28, 2019
@agnivade agnivade added FeatureRequest Issues asking for a new feature that does not need a proposal. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 28, 2019
@josharian
Copy link
Contributor

How about git-codereview set LANG=en_US for all git calls that it makes under the hood?

@ericlagergren
Copy link
Contributor Author

Sounds like a fantastic solution.

@josharian
Copy link
Contributor

Any interest in sending a fix? IIRC all git calls are funneled through a single place, so it is probably straightforward.

@ericlagergren
Copy link
Contributor Author

ericlagergren commented Aug 28, 2019 via email

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/192237 mentions this issue: x/review: override existing locale with LC_ALL=C

@ALTree ALTree added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 23, 2019
@golang golang locked and limited conversation to collaborators Nov 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants