Skip to content

Show git output *after* the generic error message. - #16628

Merged
mefyl merged 1 commit into
ocaml:mainfrom
mefyl:feat/cleaner-git-output
Oct 30, 2026
Merged

mefyl merged 1 commit into
ocaml:mainfrom
mefyl:feat/cleaner-git-output

Conversation

@mefyl

@mefyl mefyl commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Description

When reporting back git-related error messages, put the verbatim git output at the end for better readability, since it carries the actual cause of the failure.

Related Issue and Motivation

Suggested by @Alitzer in #16466.

I also tried prefixing the ouptut with git| for better readability, example output. Clearly open to suggestions on how to improve this.

  $ dune pkg lock 2>&1 | dune_cmd subst "$AMBIGUOUS_REF" '$AMBIGUOUS_REF' | dune_cmd subst "$PWD" '$PWD'
  File "dune-workspace", line 6, characters 6-201:
  6 |  (url "git+file://$PWD/mock-opam-repository#$AMBIGUOUS_REF"))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  could not fetch revision "$AMBIGUOUS_REF" from file://$PWD/mock-opam-repository
  
  git| warning: ignoring --negotiation-restrict=refs/dune-pkg/file____home_mefyl_dev_tarides_dune__build__sandbox_3af426c39ef82b865c423870c731ea2a_default_test_blackbox-tests_test-cases_pkg_mock-opam-repository/* because it does not match any refs
  git| fatal: remote error: upload-pack: not our ref $AMBIGUOUS_REF
  git| fatal: git upload-pack: not our ref $AMBIGUOUS_REF

Checklist

  • Tests added, if applicable.
  • Change log entry added for any user-facing changes.
  • Documentation added for any user-facing changes.

@mefyl

mefyl commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

Built on top of #16623, which must pass first.

Signed-off-by: mefyl <quentin@tarides.com>
@mefyl
mefyl force-pushed the feat/cleaner-git-output branch from e229c55 to 5afa65e Compare October 19, 2026 14:30
@mefyl
mefyl merged commit 5d80441 into ocaml:main Oct 30, 2026
39 checks passed
@Alizter Alizter added this to the 3.26.0 milestone Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants