Provide more output for Git errors on push #751
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This provides Git's stderr output when errors occur trying to push catalogs. Previously, only the exit code was returned, which usually is simply 1 and not very specific.
Background
The default branch in most Git hosting environments is called
main
now, but Commodore seems to expect the remote HEAD to bemaster
. Trying acommodore catalog compile --push
on a catalog repository withmain
as default branch will fail with "error: src refspec master does not match any...".It would be cleverer to make Commodore read the default branch name from the remote repo and use that instead. But in the meantime, having more error output at least makes it possible to narrow down the cause of a push problem.
Problems
The stderr output seems to be truncated (by the GitRepo module?). I couldn't figure out how to get the whole output without the truncated first line. Subsequent lines seem OK?
Update: Actually, this may also be a new issue in Git itself. When pushing from the command-line, it also truncates after "does not match any" for me.
Checklist
bug
,enhancement
,documentation
,change
,breaking
,dependency
,internal
as they show up in the changelog