Skip to content

Print multi-line git errors readably #49

Open

Description

@typeweaver

Since #30, a fatal git error other than "not a git repository" is reported with git's own message. For the most common case, a repository git refuses to trust, git's message spans several lines and ends with the fix (git config --global --add safe.directory …). codeheat escapes every control character in that message for the terminal, so the user sees one line full of \u000a and \u0009, and the hint is hard to read.

The escaping is deliberate: untrusted text (paths, git output) must not start new lines or recolor the terminal (apps/cli/src/output/escape.ts).

Idea: print git's stderr line by line, escaping each line on its own, with a fixed indent, so newlines come from codeheat and not from the untrusted text. Tabs could become spaces.

Done when: the dubious-ownership failure prints git's lines readably (journey test with GIT_TEST_ASSUME_DIFFERENT_OWNER=1), control characters inside a line are still escaped, and no other error message changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions