Skip to content

🐛 git grep --heading breaks long paths #2031

@pre

Description

@pre

Long paths get broken by delta with git grep --heading. There's no real truncate, the path is as long as before, but one - character is replaced with :

Image

Reproduction:

mkdir /tmp/repro
cd /tmp/repro
git init
mkdir -p first/second/third/fourth/longer-path-which-triggers-truncate
echo 'hello truncate' > first/second/third/fourth/longer-path-which-triggers-truncate/example.txt
git add .
git commit -m test

git grep --heading hello

Actual output ("longer:path"):

first/second/third/fourth/longer:path-which-triggers-truncate/example.txt
1:hello truncate

Expected output ("longer-path"):

first/second/third/fourth/longer-path-which-triggers-truncate/example.txt
1:hello truncate

.gitconfig

[core]
  pager = delta

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions