Skip to content

If commit range is incorrect, hunk hangs #1193

Open

Description

@ssojoodi

What happened?

❯ hunk diff main..HEAD
hunk: hunk diff main..HEAD could not resolve Git revision or range main..HEAD.

Check the revision or range and try again.
(hangs at this point until Ctrl-C)

root cause: main not a branch in this repo, master..HEAD works perfectly.

Image

Steps to reproduce

try doing branch diffs with at least one branch that doesn't exist.

❯ hunk diff main..HEAD
hunk: hunk diff main..HEAD could not resolve Git revision or range main..HEAD.

Check the revision or range and try again.
(hangs at this point until Ctrl-C)

root cause: main not a branch in this repo, master..HEAD works perfectly.

Expected behavior

No response

Version

No response

Activity

  1. squad-joey commented on Oct 19, 2026

    @squad-joey
    Contributor

    I reproduced this on v0.23.0 source, but not on current 0.24.0 source. In my case it depends on terminal color detection, not whether the missing branch is named main.

    Using Linux x86_64, Bun 1.4.2, each revision's frozen dependencies, clean per-case HOME/config and an isolated PTY:

    hunk diff HUNK1193_MISSING_BRANCH..HEAD
    Source revision PTY result
    v0.23.0, 7991d3034af1d2116e9c77db31265e409a73bd9f Prints the reported revision error, then remains alive until my 5s test deadline
    main / 0.24.0, a0e3cf536ef941f6bdff928113a19006af023ce8 Prints the same error and exits 1 in about 0.13s

    Additional checks:

    • v0.23.0 still hangs with --no-extensions, and with explicit --theme auto or --theme terminal.
    • --theme github-dark avoids the hang on v0.23.0 in the same PTY (exit 1 in about 0.12s).
    • Current source exits 1 with all three explicit themes too; auto/terminal take about 0.28–0.29s.
    • Both revisions exit 1 normally when run with pipes rather than a PTY. --help exits 0 on both with either setup; the valid HEAD..HEAD pipe control exits 0.

    The old PTY output includes the terminal color queries. The existing detectTerminalColors cleanup change in #1130 restores paused stdin when it wasn't previously flowing, with a comment specifically covering startup failure before a renderer takes ownership. That is consistent with this result; I haven't bisected the exact release boundary or tested a new patch.

    These were source launches, not the installed/Homebrew/compiled binary. The test PTY did not answer the color queries, so this covers the timeout path rather than a particular terminal emulator's responses. Could you share hunk --version, installation method, terminal/OS and configured theme—and whether it still happens after updating to 0.24.0?

    This comment was generated by Pi using GPT-6.1 Sol

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions