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

Can't stage lines when using custom textconv diff driver #4196

Open
staticssleever668 opened this issue Jan 21, 2025 · 0 comments
Open

Can't stage lines when using custom textconv diff driver #4196

staticssleever668 opened this issue Jan 21, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@staticssleever668
Copy link

staticssleever668 commented Jan 21, 2025

Describe the bug
Can't stage lines when using custom textconv diff driver. Either garbage gets applied or an error appears.

error: patch failed: cp866.txt:1
error: cp866.txt: patch does not apply

To Reproduce
Steps to reproduce the behavior:

  1. Set up a custom textconv driver in your gitconfig
[diff "my-diff-cp866"]
  textconv = "iconv -f cp866"
  1. cd "$(mktemp -d)" && echo "*.txt text diff=my-diff-cp866" >> .gitattributes && git init && echo -e "КОТ1\\nКОТ2" > utf8.txt && echo -e "КОТ1\\nКОТ2" | iconv -t cp866 > cp866.txt
  2. lazygit and try to stage lines in cp866.txt and utf8.txt
    First time stages garbage. Second time gives an error.

Expected behavior
A line is staged.

Screenshots

Version info:
commit=, build date=, build source=nix, version=0.45.0, os=linux, arch=amd64, git version=2.47.0

Additional context
Perhaps wherever lazygit invokes git-diff with --no-ext-diff it should also use --no-textconv.

@staticssleever668 staticssleever668 added the bug Something isn't working label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant