Skip to content

mnemonicPrefix = true in gitconfig breaks hunk staging #6096

Closed

Description

@bo5o

Describe the bug

Setting mnemonicPrefix = true under [diff] in gitconfig breaks staging hunks in the latest lazygit. Pressing space in the focused diff shows "Apply Patch" in the command log, but nothing gets staged. Discarding and unstaging are affected the same way.

To Reproduce

Steps to reproduce the behavior:

  1. git config --global diff.mnemonicPrefix true
  2. Modify a tracked file in any repo
  3. In lazygit, select the file in the Files panel and press enter to focus its diff
  4. Press space on a hunk or line
  5. "Apply Patch" appears in the command log, but the change stays unstaged (git status confirms)

Expected behavior

The selected hunk or line is staged, the same as without diff.mnemonicPrefix.

Screenshots

n/a

Version info:

commit=c5f7158154602d23b0750d4304c73e2aead8df5b, build date=2026-10-05T17:12:24Z, build source=binaryRelease, version=0.66.0, os=linux, arch=amd64, git version=2.55.0

Terminal info:

Ghostty 1.3.1

Additional Context

None

Activity

  1. added
    bugSomething isn't working
    on Oct 7, 2026
  2. stefanhaller commented on Oct 7, 2026

    @stefanhaller
    Collaborator

    @bo5o Thanks for reporting; fixed in #6099. I added a second PR that makes lazygit show an error popup in such a case rather than silently doing nothing (#6100); the second PR is stacked on the first, so if you want to test the fix (which I would appreciate), please use a build of #6100.

  3. arlopezg commented on Oct 7, 2026

    @arlopezg

    I noticed the same issue yesterday after updating, but couldn't quite describe what was wrong (or what caused it). I built #6100 locally just now and can confirm it seems to be fixed.

    v0.66 dev
    2026-10-07_21-27-13.mp4
    2026-10-07_21-28-06.mp4

    (env: Arch with mnemonicPrefix=true)

  4. added a commit that references this issue on Oct 10, 2026
    47e7a13
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions