git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Wrong tabs in terminal output for git diff

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 14, 2021, 01:26 UTC
Message-ID
<xmqqa6nt1bkd.fsf@gitster.g>
In-Reply-To
<YMWD6G14YxfM1uE6@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> 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.

Show 5 quoted lines
> 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/
Previous: Jeff King
Message 5 of 5 in “Wrong tabs in terminal output for git diff”
  1. Timothy MaddenJun 11, 2021
  2. Felipe ContrerasJun 11, 2021
  3. Phil HordJun 12, 2021
  4. Jeff KingJun 13, 2021
  5. Junio C HamanoJun 14, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.