Skip to content

Conversation

pandemicsyn
Copy link
Member

Right now when go-git encounters an error we end up not printing a very useful error since it ends being unwrapped. e.g.

ERROR: reference not found

With this change we should bubble up a more detailed error that should more directly hint at the problem:

ERROR: git resolve revision '"HEAD"' failed: reference not found

divolgin
divolgin previously approved these changes Oct 10, 2024

rev, branch, isDirty, err := r.gitSHABranch()
if err != nil {
return errors.Wrapf(err, "get git properties")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you can keep this wrap, but git prefixes in the other errors make them trackable enough

@pandemicsyn pandemicsyn marked this pull request as ready for review October 11, 2024 01:03
@pandemicsyn pandemicsyn requested a review from divolgin October 11, 2024 01:03
@divolgin divolgin merged commit f2a6981 into main Oct 11, 2024
6 checks passed
@pandemicsyn pandemicsyn deleted the chore/florian-log-more-detailed-git-errors branch October 22, 2024 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants