Skip to content

hunk pager fails with git diff when diff.mnemonicPrefix = true (no output or "no files match the filter") #265

@CaioBianchi

Description

@CaioBianchi

Issue

When hunk is configured as the pager for git diff (via pager.diff = hunk pager or similar), git diff often produces no output or the error "no files match the filter".

Running hunk diff directly works fine and shows the expected diff.

Steps to reproduce

Add this to your ~/.gitconfig (or equivalent)

[diff]
    mnemonicPrefix = true

Configure hunk as pager (example)

[core]
    pager = hunk pager

Run git diff (on a repo with changes).

Expected behavior

git diff should pipe the diff to hunk pager and display it nicely (with sidebar, etc., as in recent releases).

Actual behavior

  • Often blank output
  • Or hunk complains that no files match the filter
  • hunk diff works as a workaround

Additional context / Workaround

Commenting out / setting diff.mnemonicPrefix = false makes hunk pager work again.
This setting changes diff prefixes from the standard a/ / b/ to more informative ones like i/ (index), w/ (worktree), c/ (commit), etc. Many tools that parse git diffs assume the default prefixes, so this is likely a parsing incompatibility.

Environment

hunk version: 0.11.0
OS: macOS
Git version: 2.54.0
Terminal: Ghostty

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggitGit workflows and features

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions