Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delta should be aware of diff.noprefix option (truncated filenames) #120

Closed
wookayin opened this issue Apr 7, 2020 · 3 comments · Fixed by #124
Closed

Delta should be aware of diff.noprefix option (truncated filenames) #120

wookayin opened this issue Apr 7, 2020 · 3 comments · Fixed by #124

Comments

@wookayin
Copy link

wookayin commented Apr 7, 2020

The diff.noprefix option (e.g. git config diff.noprefix true) would strip away prefixes such as a/ b/. When this option is enabled, the first two characters of filename would be stripped away even though they are a part of normal filenames.

Expected output: (without diff.noprefix)

package/filename.py
────────────────────────────────────────
...

Actual behavior:

ckage/filename.py
────────────────────────────────────────
...

Tested on 0.0.17.

Although we could configure so that this option is turned off when using delta as pager, delta should be aware of this option and strip prefixes only if the first two letters are git prefixes.

@dandavison
Copy link
Owner

Thanks @wookayin, I agree. Sorry for being slow, I missed the notification here. This sounds like it should be an easy change.

@dandavison
Copy link
Owner

That should be fixed in master. If a user has git.noprefix = true, and also has directories genuinely named "a" or "b", then there will still be incorrect stripping.

@wookayin
Copy link
Author

Thanks! Yeah, I can imagine the corner case but should be fine for the most cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants