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

Re: [PATCH] diff.tcl: fixed alignment of tabs in git-gui diff by using spaces

From
GitHub Chris Idema <github_chris_idema@proton.me>
Date
Jan 26, 2026, 15:21 UTC
Message-ID
<cN1fnsEmJFcm0Tn-hnMbo4tx4U4_SXBxO1s7j0NjOOv2Fn-sH0IsQTX2QqxD7g1bt_7aOSjXNEIBoLAMJT25UZLwr-Uzh9jFC_vBZ9QlLy8=@proton.me>
In-Reply-To
<5ab10a31-8ee5-48f9-a5fd-63c6d7f4adcf@kdbg.org>
> I am not particularly fond of such a change. Years and years of reading

patch text has trained my brain to expect such misalignment to the extent that even the absence of misalignment can sometimes indicate a whitespace error.

The problem is not just incorrect alignment. It's also inconsistency. In gitk the alignment is correct. In the git gui window it's not.  The best solution would be to make the git gui window behave like gitk. I thought my change only affected the way it was displayed. I'm going to see if there is a better way.
-- Chris

-------- Original Message -------- On Monday, 01/26/26 at 15:52 Johannes Sixt <j6t@kdbg.org> wrote: Am 26.01.26 um 15:43 schrieb GitHub Chris Idema:

>> So, you mean that if the tab width is set to 4, then the tab stops
>> are not aligned anymore?
>
> Indeed. It's probably due to the + character shifting everything by 1 character.

BTW, this isn't a problem with a particular tab width. It happens with the default width 8 as well.

Show 6 quoted lines
>> My suspicion is that the patch text does not match the actual file
>> contents, and so the commands fail.
>
> If you select and copy the text from the window with you mouse it
> won't match the patch. I didn't know people used it that way. I use
> it as a way to review my changes before staging.

I don't mean copy-and-paste. I mean the context menu commands. They stop working (I suspect). This would be a show-stopper.

> I don't know if there is a way to make it that when you copy it will
> copy the original text and no the modified text. If not then we
> should come up with a better way to align stops.

I am not particularly fond of such a change. Years and years of reading patch text has trained my brain to expect such misalignment to the extent that even the absence of misalignment can sometimes indicate a whitespace error.

-- Hannes
Previous: Johannes SixtNext: GitHub Chris Idema
Message 7 of 30 in “diff.tcl: fixed alignment of tabs in git-gui diff by using spaces”
  1. diff.tcl: fixed alignment of tabs in git-gui diff by using spacesChris Idema via GitGitGadget, Jan 26, 2026
  2. Johannes SixtJan 26, 2026
  3. GitHub Chris IdemaJan 26, 2026
  4. Johannes SixtJan 26, 2026
  5. GitHub Chris IdemaJan 26, 2026
  6. Johannes SixtJan 26, 2026
  7. GitHub Chris IdemaJan 26, 2026
  8. GitHub Chris IdemaJan 26, 2026
  9. 0/2 diff.tcl: Fixed alignment of tabs in git-gui diff by using spaces.Chris Idema via GitGitGadget, Jan 27, 2026
  10. 2/2 diff.tcl: call "apply_tab_size 1" to fix alignment instead of spaces.Chris Idema via GitGitGadget, Jan 27, 2026
  11. Junio C HamanoJan 27, 2026
  12. Junio C HamanoJan 27, 2026
  13. GitHub Chris IdemaJan 28, 2026
  14. Johannes SixtJan 28, 2026
  15. GitHub Chris IdemaJan 28, 2026
  16. Johannes SixtJan 28, 2026
  17. Junio C HamanoJan 28, 2026
  18. Junio C HamanoJan 29, 2026
  19. GitHub Chris IdemaJan 29, 2026
  20. Johannes SixtJan 29, 2026
  21. Junio C HamanoJan 29, 2026
  22. 1/2 diff.tcl: fixed alignment of tabs in git-gui diff by using spacesChris Idema via GitGitGadget, Jan 27, 2026
  23. diff.tcl: made alignment of tabs in git-gui diff consistent with gitkChris Idema via GitGitGadget, Jan 28, 2026
  24. Johannes SixtJan 28, 2026
  25. GitHub Chris IdemaJan 28, 2026
  26. Junio C HamanoJan 29, 2026
  27. git-gui: shift tabstops to account for the first column of context diffsChris Idema via GitGitGadget, Jan 29, 2026
  28. Johannes SixtJan 29, 2026
  29. GitHub Chris IdemaMar 4, 2026
  30. Johannes SixtMar 4, 2026

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.