Thread (1 message) 1 message, 1 author, 2021-06-14

Re: Wrong tabs in terminal output for git diff

From: Junio C Hamano <hidden>
Date: 2021-06-14 01:26:14

Jeff King [off-list ref] writes:
We do have a few "display only" modes. You mentioned --color-words, but
--textconv is similar (and of course --ext-diff can generate whatever it
wants). I'm not sure how helpful that is, though, because humans end up
needing to look at "real" diffs that can be applied often enough (and as
you note, changing those would break them).
Add "--irreversible-delete" to the set.  We should perhaps find a
migration path to eventually disable these "display only" things in
format-patch [*1*], if we do not already do so.
This could be addressed at the viewing layer, though, which is what's
converting the tabstops to screen positions. For example, "less -x9,17"
adjusts the tab stops in the pager to account for the extra leading
character (and you can put it into $LESS or $GIT_PAGER to have it kick
in automatically).
That's a cute one (and can be used not just on "git diff" output but
on output from "diff" by other people).

Thanks.


[References]

*1* https://lore.kernel.org/git/7vsj8dcdv6.fsf@alter.siamese.dyndns.org/ (local)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help