Skip to content

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

Closed
mefyl wants to merge 1 commit into
fix/revision-not-found-error-messagefrom
feat/cleaner-git-output
Closed

mefyl wants to merge 1 commit into
fix/revision-not-found-error-messagefrom
feat/cleaner-git-output

Conversation

@mefyl

@mefyl mefyl commented Oct 16, 2026

Copy link
Copy Markdown
Owner

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 ocaml#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.

Signed-off-by: mefyl <quentin@tarides.com>
@mefyl
mefyl force-pushed the feat/cleaner-git-output branch from a35c7ab to e229c55 Compare October 16, 2026 21:31
@mefyl

mefyl commented Oct 16, 2026

Copy link
Copy Markdown
Owner Author

Superseded

@mefyl mefyl closed this Oct 16, 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.

1 participant