-
Notifications
You must be signed in to change notification settings - Fork 27.4k
diff.tcl: Fixed alignment of tabs in git-gui diff by using spaces. #2179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Welcome to GitGitGadgetHi @ChrisIdema, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests. Please make sure that either:
You can CC potential reviewers by adding a footer to the PR description with the following syntax: NOTE: DO NOT copy/paste your CC list from a previous GGG PR's description, Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:
It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code. Contributing the patchesBefore you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a comment to your PR of the form Both the person who commented An alternative is the channel Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment If you want to see what email(s) would be sent for a After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions (while the comments and suggestions will be mirrored into the PR by GitGitGadget, you will still want to reply via mail). If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox from the Git mailing list archive (click the curl -g --user "<EMailAddress>:<Password>" \
--url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txtTo iterate on your change, i.e. send a revised patch or patch series, you will first want to (force-)push to the same branch. You probably also want to modify your Pull Request description (or title). It is a good idea to summarize the revision by adding something like this to the cover letter (read: by editing the first comment on the PR, i.e. the PR description): To send a new iteration, just add another PR comment with the contents: Need help?New contributors who want advice are encouraged to join git-mentoring@googlegroups.com, where volunteers who regularly contribute to Git are willing to answer newbie questions, give advice, or otherwise provide mentoring to interested contributors. You must join in order to post or view messages, but anyone can join. You may also be able to find help in real time in the developer IRC channel, |
|
There are issues in commit 7bb5327:
|
7bb5327 to
65f38e0
Compare
|
All tests passed except handle_pr_push due to "API rate limit exceeded". Don't know if that's an issue. @Ikke can you "allow" me? Thank you in advance. |
|
/allow |
|
User ChrisIdema is now allowed to use GitGitGadget. |
|
/preview |
|
Preview email sent as pull.2179.git.git.1769262113715.gitgitgadget@gmail.com |
65f38e0 to
5510d35
Compare
|
/preview |
|
Preview email sent as pull.2179.git.git.1769423599635.gitgitgadget@gmail.com |
Tabs were not properly rendered in TK regardless of tab width settings. Converting tab alignment to spaces before rendering in TK fixes this. Does not fix alignment issues in gitk. Signed-off-by: Chris Idema <github_chris_idema@proton.me>
5510d35 to
f2a09c1
Compare
|
/preview |
|
Preview email sent as pull.2179.git.git.1769424177396.gitgitgadget@gmail.com |
|
/submit |
|
Submitted as pull.2179.git.git.1769424301394.gitgitgadget@gmail.com To fetch this version into To fetch this version to local tag |
|
Johannes Sixt wrote on the Git mailing list (how to reply to this email): Am 26.01.26 um 11:45 schrieb Chris Idema via GitGitGadget:
> From: Chris Idema <github_chris_idema@proton.me>
>
> Tabs were not properly rendered in TK regardless of tab width settings.
Sorry, I cannot reproduce what I read into this sentence. When I change
the "Tab spacing" option in the Options dialog, the display changes to
the specified tab width. I'm using Tcl/Tk 8.6.
> Converting tab alignment to spaces before rendering in TK fixes this.
Do "Stage Line/Hunk for Commit" still work after this conversion?
-- Hannes
|
|
User |
|
GitHub Chris Idema wrote on the Git mailing list (how to reply to this email): > Sorry, I cannot reproduce what I read into this sentence. When I change
the "Tab spacing" option in the Options dialog, the display changes to
the specified tab width. I'm using Tcl/Tk 8.6.
I use git for Windows version "2.52.0.windows.1" on Windows 11.
Here is how you can reproduce the problem:
mkdir test_tabs
cd test_tabs
git init
echo "" > test.c
git add .
git commit -m "initial commit"
echo -e "int test1\t= 5;\nint test11\t= 6;\nint test111\t= 6;\n" > test.c
git gui
> Do "Stage Line/Hunk for Commit" still work after this conversion?
I'm sorry but I don't know what this means.
-- Chris
-------- Original Message --------
On Monday, 01/26/26 at 13:15 Johannes Sixt <j6t@kdbg.org> wrote:
Am 26.01.26 um 11:45 schrieb Chris Idema via GitGitGadget:
> From: Chris Idema <github_chris_idema@proton.me>
>
> Tabs were not properly rendered in TK regardless of tab width settings.
Sorry, I cannot reproduce what I read into this sentence. When I change
the "Tab spacing" option in the Options dialog, the display changes to
the specified tab width. I'm using Tcl/Tk 8.6.
> Converting tab alignment to spaces before rendering in TK fixes this.
Do "Stage Line/Hunk for Commit" still work after this conversion?
-- Hannes
|
|
Johannes Sixt wrote on the Git mailing list (how to reply to this email): Am 26.01.26 um 14:32 schrieb GitHub Chris Idema:
> Here is how you can reproduce the problem:
> mkdir test_tabs
> cd test_tabs
> git init
> echo "" > test.c
> git add .
> git commit -m "initial commit"
> echo -e "int test1\t= 5;\nint test11\t= 6;\nint test111\t= 6;\n" > test.c
> git gui
So, you mean that if the tab width is set to 4, then the tab stops are
not aligned anymore?
>> Do "Stage Line/Hunk for Commit" still work after this conversion?
> I'm sorry but I don't know what this means.
These are commands in the context menu of the diff panel. They extract
the text from the widget and massage it into a patch. My suspicion is
that the patch text does not match the actual file contents, and so the
commands fail.
-- Hannes
|
|
GitHub Chris Idema wrote on the Git mailing list (how to reply to this email): > 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.
> 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 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.
-- Chris
-------- Original Message --------
On Monday, 01/26/26 at 14:59 Johannes Sixt <j6t@kdbg.org> wrote:
Am 26.01.26 um 14:32 schrieb GitHub Chris Idema:
> Here is how you can reproduce the problem:
> mkdir test_tabs
> cd test_tabs
> git init
> echo "" > test.c
> git add .
> git commit -m "initial commit"
> echo -e "int test1\t= 5;\nint test11\t= 6;\nint test111\t= 6;\n" > test.c
> git gui
So, you mean that if the tab width is set to 4, then the tab stops are
not aligned anymore?
>> Do "Stage Line/Hunk for Commit" still work after this conversion?
> I'm sorry but I don't know what this means.
These are commands in the context menu of the diff panel. They extract
the text from the widget and massage it into a patch. My suspicion is
that the patch text does not match the actual file contents, and so the
commands fail.
-- Hannes
|
|
Johannes Sixt wrote on the Git mailing list (how to reply to this email): 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.
>> 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
|
|
GitHub Chris Idema wrote on the Git mailing list (how to reply to this email): > 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.
>> 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
|
|
GitHub Chris Idema wrote on the Git mailing list (how to reply to this email): It appears inserting "apply_tab_size 1" fixes the issue. But I don't know if I'm inserting it in the right place.
-- Chris
|
921db49 to
79fbf11
Compare
79fbf11 to
72955cf
Compare
Signed-off-by: Chris Idema <github_chris_idema@proton.me>
72955cf to
382705d
Compare
|
Why is the win + meson build failing? |
|
/preview |
|
Preview email sent as pull.2179.v2.git.git.1769521445.gitgitgadget@gmail.com |


cc: Johannes Sixt j6t@kdbg.org