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

Log git's output somewhere when git commands fail #220

Open
robbert-vdh opened this issue May 17, 2023 · 0 comments
Open

Log git's output somewhere when git commands fail #220

robbert-vdh opened this issue May 17, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@robbert-vdh
Copy link
Member

As far as I'm aware, there's no universal or obvious way to see git's output when Hoff invokes a a git command and that command fails with an error code. I ran into this when I tried running Hoff with stack run -- config.json after having already set up Hoff once. If Stack's Nix integration is enabled, then this will result the following cryptic error being printed to STDERR and posted as a comment to GitHub:

Failed to rebase, please rebase manually using

git fetch && git rebase --interactive --autosquash origin/master another-fix

In reality, the actual issue was the same issue already documented in the readme where the ssh binary isn't in the search path since stack run by default uses nix-shell --pure. If you ran Hoff this way for the first time you may get a clearer error message indicating that git couldn't find ssh during the original clone, but if the repo is already checked out then you now get this spurious rebase failure error when issuing a merge command. Since git command line failures are either caused by merge conflicts or by actual important errors like these, I think it may make sense to log them directly. Perhaps using a log level that can be disabled in production if merge conflict messages end up taking up too much logging bandwidth (don't think that would be an actual issue though).

Any thoughts?

@robbert-vdh robbert-vdh added enhancement New feature or request good first issue Good for newcomers labels May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant