Re: Wrong tabs in terminal output for git diff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 11, 2021 at 12:30 PM Timothy Madden <terminatorul@xxxxxxxxx> wrote:
> For git diff and git show commands, terminal output appears with wrong
> tab stops (missaligned).
>
> Because diff operation inserts a new column at character position 1, for
> the +, - and space characters, the diff content appears shifted to the
> right by 1 column. But not the tab stop positions. So relative to the
> text, the tab stops now appear off-by-one (shifted to the left).

I think "fixing" this would require modifying the diff output so it
would no longer be correct. If we accept that a switch can make a
incorrect diff for display only, though, it seems something could be
done here.

I think the only approach that can fix the alignment, however, is to
remove the +/- prefix markers altogether.  We do this now with the
`--color-words` switch. This kind of solution only works if there is
some way to indicate added/removed lines other than the line-prefix
marker; ANSI color codes, for example.  Would that work for your
needs, or were you thinking of something else?



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux