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

Beautify Git subprocess errors #19

Open
defreng opened this issue Aug 18, 2022 · 0 comments
Open

Beautify Git subprocess errors #19

defreng opened this issue Aug 18, 2022 · 0 comments
Labels
enhancement New feature or request fengine good first issue Good for newcomers

Comments

@defreng
Copy link
Contributor

defreng commented Aug 18, 2022

The current Git subprocess errors in foxops are quite unreadable:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/foxops/external/git.py", line 24, in git_exec
    return await check_call("git", *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/foxops/utils.py", line 35, in check_call
    raise CalledProcessError(
  foxops.utils.CalledProcessError: Command '['git', 'push', '--porcelain', '-u', 'origin', b'main']' returned non-zero exit status 1. with stdout 'b'To https://[redacted].git\n!\trefs/heads/main:refs/heads/main\t[rejected] (fetch first)\nDone\n'' and stderr 'b"error: failed to push some refs to 'https://[redacted].git'\nhint: Updates were rejected because the remote contains work that you do\nhint: not have locally. This is usually caused by another repository pushing\nhint: to the same ref. You may want to first integrate the remote changes\nhint: (e.g., 'git pull ...') before pushing again.\nhint: See the 'Note about fast-forwards' in 'git push --help' for details.\n"'

It would be great to render the errors beautifully as they would be when running Git directly in a terminal. Print stdout and stderr separately.

@defreng defreng added enhancement New feature or request good first issue Good for newcomers labels Aug 18, 2022
@defreng defreng changed the title Beautify foxops Git subprocess errors Beautify Git subprocess errors Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fengine good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant