Subject: Re: [PATCH/RFC v2 2/2] diff.tcl: call "apply_tab_size 1" to fix alignment instead of spaces.

From: Johannes Sixt <[email-masked]>
Date: Wed, 28 Jan 2026 16:59:55 +0100

Am 28.01.26 um 15:02 schrieb GitHub Chris Idema:
>> I concur. Also, "apply_tab_size 0" is needed when the contents of
>> an unstaged file are shown instead of patch text.
> 
> Can you explain why it's needed?
> The file in my example is unstaged and it's a patch text.
> ...
> Can you show me how to get content without patch text in the window?

Sorry, I meant "untracked file". When the text of an untracked file is
displayed, we do not want to offset the tabstops.

> 
>> +	if {$have_tk85 && $firsttab != 0} {
> 
> Gives me the error "can't read "have_tk85": no such variable"
> If I substitute 1 or 0 for have_tk85 it doesn't fix the alignment.

This was not a suggested fix, but a citation of the patch that
introduced the function. The variable has since been eliminated.

> I'm open for suggestions. My 1 line code change fixes the problem,
> but if it is not the official way to do it or if it introduces other
> problems feel free to suggest another fix.

It may fix the problem for regular patch text. But I doubt that it is a
correct fix for combined-diff text, because that needs offset 2.

> For us this bug is a show stopper that makes the diff in the
> git-gui window by default unreadable.

Earlier, I said that I'm not fond of such a change. But I changed my
mind. I hadn't noticed so far that Gitk applies customized tabstops. Git
GUI and Gitk need not emulate the behavor of terminal windows faithfully
and can be more clever as far as tabstops are concerned.

-- Hannes