Closed ewen-lbh closed 3 years ago
On second thought, it might be because the filename has spaces (i.e. needs escaping) and that quotepath
is turned off.
Still, quotepath = off
is needed for me, else I can't use lazygit with non-ASCII filenames.
Changing the title.
Just tested it out: even with core.quotepath = on
, delta still panics. Updating the title.
Thanks very much @ewen-lbh for the detailed report. I can reproduce this (regression introduced at https://github.com/dandavison/delta/pull/605, failing to parse file names with spaces in diff --git ...
line)
A file named a/b
is OK, so I've changed the title to "...when diffing file with spaces in its name".
This has been fixed and released in 0.8.1
The fix to this issue actually caused a regression for me:
~
❯ delta --version
delta 0.8.1
~
❯ delta ~/Library/Application\ Support/qBittorrent/Preferences/qBittorrent.ini ~/.config/qBittorrent/qBittorrent.ini
error: Found argument '/Users/kid/.config/qBittorrent/qBittorrent.ini' which wasn't expected, or isn't valid in this context
USAGE:
delta [FLAGS] [OPTIONS] [ARGS]
For more information try --help
~
❯ ./delta --version
delta 0.8.0
~
❯ ./delta ~/Library/Application\ Support/qBittorrent/Preferences/qBittorrent.ini ~/.config/qBittorrent/qBittorrent.ini | head -n 5
diff --git a/Users/kid/Library/Application Support/qBittorrent/Preferences/qBittorrent.ini b/Users/kid/.config/qBittorrent/qBittorrent.ini
index afe22c1..a9d78ee 100644
--- a/Users/kid/Library/Application Support/qBittorrent/Preferences/qBittorrent.ini
+++ b/Users/kid/.config/qBittorrent/qBittorrent.ini
@@ -1,3 +1,8 @@
Environment: fish 3.2.2 on macOS
Hi @kidonng, thanks! That seems, at first glance, strange (but I can reproduce it). That's a command-line parsing error, and I don't immediately see what has changed between 0.8.0 and 0.8.1 that would cause a change in how positional filename arguments are parsed (versions of structopt and clap didn't change). Anyway, clearly I'm missing something. Someone shout out if they happen to see what that is!
Ah, OK, it's this: https://github.com/dandavison/delta/commit/230f5468f7adddc098ab7b8cb241f06e497ae0d2 Some sort of shell escaping is needed if we're going to transmit arguments on to the child process like that.
That's fixed in master.
Awesome 👍
Released in 0.8.2
I tried running
git diff
on "completely-rewritten file", because there are clearly a lot of lines that are common and a plain git diff (inside lazygit) wasn't cutting it (notably I was wondering if it wasn't a spaces v tab problem).I'm running Manjaro 21.0.5 on kernel 5.12.2-1-MANJARO. I tried both the source and binary packages from the AUR (git-delta and git-delta-bin), as well as an install through cargo.
The raw git diff is quite large, so I put it at the end.
Here's the exception (from the cargo install, others had way less details in the stacktrace)
The raw diff:
In case it is useful, my .gitconfig file: