bradleyfalzon / revgrep

Filters output from static analysis tools, showing only recently changed lines of code
Apache License 2.0
103 stars 15 forks source link

`git diff` error silenced #18

Open amenasria opened 1 year ago

amenasria commented 1 year ago

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:

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 commented 1 year ago

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

amenasria commented 9 months ago

Small bump on this !

bradleyfalzon commented 9 months ago

Sorry mate, will try and get time next couple of days, but within the next week definitely. Just on holiday not near laptop.

Bradley Falzon

On Fri, 26 Jan 2024 at 11:23β€―pm, Alexandre Menasria < @.***> wrote:

Small bump on this !

β€” Reply to this email directly, view it on GitHub https://github.com/bradleyfalzon/revgrep/issues/18#issuecomment-1912062428, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN74UPTKHYKBGV3V7ACKSDYQOU6PAVCNFSM6AAAAAA7MZOSOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSGA3DENBSHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

amenasria commented 9 months ago

πŸ‘‹ Hey, no problem Bradley, I understand !