🐛 Delta removes old/new mode lines in diff output
When a file's mode is changed, git diff will emit lines in between the diff --git a/path b/path line and the index hash1..hash2 line that shows the mode change. Unfortunately delta discards this entire header, including the mode change. Using --color-only or --diff-highlight preserves these lines, but otherwise they get removed.
This is rather annoying as the mode changes are actually important.
git diff --no-pager output:
diff --git a/tools/is_ci.tcl b/tools/is_ci.tcl
old mode 100644
new mode 100755
index d984ab2c65..d047b92be6
--- a/tools/is_ci.tcl
+++ b/tools/is_ci.tcl
@@ -6,10 +6,10 @@ namespace import util::*
proc usage {} {
return "usage: [file tail $::argv0] \[-q]
-
+
Options:
-q --quiet Suppress all output.
-
+
Description:
Checks if the script was invoked from within a CI environment. If so, prints
'yes', otherwise prints 'no'.
delta --no-gitconfig output (sans color):
tools/is_ci.tcl
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─────────────────────────┐
namespace import util::* │
─────────────────────────┘
6
proc usage {} {
return "usage: [file tail $::argv0] \[-q]
Options:
-q --quiet Suppress all output.
Description:
Checks if the script was invoked from within a CI environment. If so, prints
'yes', otherwise prints 'no'.
This was reproduced with delta 0.4.3.
Thanks @lilyball, I agree -- we should include mode change info by default. What do you think about displaying this as
tools/is_ci.tcl (100644 ⟶ 100755)
──────────────────────────────────────────────────────────────────────────────────────────────
?
@dandavison would that only be displayed if the mode changed and be hidden otherwise? If so, then that output would be perfect. I am really missing this in the diff output, because otherwise it just shows the entire file as being changed, so having this piece of information displayed is key to understanding what happened.