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

git diff error silenced #18

Open
amenasria opened this issue Nov 15, 2023 · 4 comments
Open

git diff error silenced #18

amenasria opened this issue Nov 15, 2023 · 4 comments

Comments

@amenasria
Copy link

amenasria commented Nov 15, 2023

Hey there 👋,

Stumbled upon some issues while working with golangci-lint.

Basically the fact that only the exit code is printed in the git diff calls in the GitPatch function but not the git diff stderr makes it really hard for people to debug. I have 2 use cases from this golangci-lint issue when using the new-from-rev feature:

  • In one case the new-from-rev commit was not in the commit tree because the Github Actions runner only had a shallow clone of the repository. From the error people just understood that the diff was not working. Having the error message would have made people understand it directly.
  • In another case (mine) the git diff didn't work because of a diff algorithm that couldn't be found in the runner. This wasn't understandable as well because no error, only the exit code.

For both issues the errors were the same:

level=warning msg="[runner] Can't process result by diff processor:
can't prepare diff by revgrep: could not read git repo: 
error executing git diff \"{revisionFrom}\" \"\"
: exit status 128"

As no one stumbled upon the seconde case I really thought I was in the same situation as the first case which made me spend a lot of time on the fix. I think it'd be a great improvment to have the error in the fmt.Errorf message.

@amenasria
Copy link
Author

Made a PR about this: #19. Down for a review whenever you have time !

@amenasria
Copy link
Author

Small bump on this !

@bradleyfalzon
Copy link
Owner

bradleyfalzon commented Jan 26, 2024 via email

@amenasria
Copy link
Author

👋 Hey, no problem Bradley, I understand !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants