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
misc/git/pre-commit: complains about unformatted files that are not staged #23136
Comments
If there is a formatting problem but it isn't staged, then it isn't relevant to the commit in progress. It might be a blocker eventually, but it isn't yet.
If there is a formatting problem but it isn't staged, then it isn't relevant to the commit in progress. It might be a blocker eventually, but it isn't yet. Change-Id: I5120407a4bd4cc047672aa10a74a530613e8c0bb
Change-Id: I56d524b98fc101199ae8a44ba8e3d5162c6f177e
I've given up on trying to figure out the preposterous prerequisites for using google's contribution system but ErinCall:precommit-staged-changes-only has a working fix and you can have it if you want |
Hello there @ErinCall, thank you for filing this issue. Please don't lose hope about contributing, it gets a whole lot better once we get over such humps :) With that said though, I'll ping some git experts for some ideas @rsc @bradfitz @ianlancetaylor. |
The Go project does accept GitHub pull requests now, if you feel like trying again. Thanks. |
Change https://golang.org/cl/104575 mentions this issue: |
I dont think this file is even used anymore. My And it looks like this behavior is controlled by a flag which needs to be set for it to check unstaged changes also. https://github.com/golang/review/blob/master/git-codereview/gofmt.go#L53. If that is satisfactory behavior, I think this file can be deleted and the issue closed. |
This is done with 0c7cdb4. Closing. |
What version of Go are you using (
go version
)?go version go1.9.2 darwin/amd64
What did you do?
(In short: have some staged changes with valid formatting and some unstaged changes with invalid formatting)
What did you expect to see?
Everything's hunky-dunky; the changes I'm committing have valid formatting
What did you see instead?
Go files must be formatted with gofmt. Please run: ...
The text was updated successfully, but these errors were encountered: