Skip to content

gitk: support config the color of linkfgcolor via Gitk Preferences#2217

Open
BLumia wants to merge 1 commit intogit:masterfrom
BLumia:gitk-linkfgcolor
Open

gitk: support config the color of linkfgcolor via Gitk Preferences#2217
BLumia wants to merge 1 commit intogit:masterfrom
BLumia:gitk-linkfgcolor

Conversation

@BLumia
Copy link

@BLumia BLumia commented Feb 26, 2026

CC: Mark Levedahl mlevedahl@gmail.com, Paul Mackerras paulus@samba.org, Johannes Sixt j6t@kdbg.org
cc: Wang Zichong wangzichong@deepin.org

@gitgitgadget-git
Copy link

Welcome to GitGitGadget

Hi @BLumia, 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:

  • Your Pull Request has a good description, if it consists of multiple commits, as it will be used as cover letter.
  • Your Pull Request description is empty, if it consists of a single commit, as the commit message should be descriptive enough by itself.

You can CC potential reviewers by adding a footer to the PR description with the following syntax:

CC: Revi Ewer <revi.ewer@example.com>, Ill Takalook <ill.takalook@example.net>

NOTE: DO NOT copy/paste your CC list from a previous GGG PR's description,
because it will result in a malformed CC list on the mailing list. See
example.

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:

  • the lines should not exceed 76 columns,
  • the first line should be like a header and typically start with a prefix like "tests:" or "revisions:" to state which subsystem the change is about, and
  • the commit messages' body should be describing the "why?" of the change.
  • Finally, the commit messages should end in a Signed-off-by: line matching the commits' author.

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 patches

Before 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 /allow. A good way to find other contributors is to locate recent pull requests where someone has been /allowed:

Both the person who commented /allow and the PR author are able to /allow you.

An alternative is the channel #git-devel on the Libera Chat IRC network:

<newcontributor> I've just created my first PR, could someone please /allow me? https://github.com/gitgitgadget/git/pull/12345
<veteran> newcontributor: it is done
<newcontributor> thanks!

Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment /submit.

If you want to see what email(s) would be sent for a /submit request, add a PR comment /preview to have the email(s) sent to you. You must have a public GitHub email address for this. Note that any reviewers CC'd via the list in the PR description will not actually be sent emails.

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 (raw) link), then import it into your mail program. If you use GMail, you can do this via:

curl -g --user "<EMailAddress>:<Password>" \
    --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt

To 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):

Changes since v1:
- Fixed a typo in the commit message (found by ...)
- Added a code comment to ... as suggested by ...
...

To send a new iteration, just add another PR comment with the contents: /submit.

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, #git-devel on Libera Chat. Remember that IRC does not support offline messaging, so if you send someone a private message and log out, they cannot respond to you. The scrollback of #git-devel is archived, though.

@rimrul
Copy link
Contributor

rimrul commented Feb 26, 2026

/allow

@gitgitgadget-git
Copy link

User BLumia is now allowed to use GitGitGadget.

@BLumia
Copy link
Author

BLumia commented Feb 26, 2026

/preview

@gitgitgadget-git
Copy link

Preview email sent as pull.2217.git.git.1772109051178.gitgitgadget@gmail.com

@BLumia
Copy link
Author

BLumia commented Feb 26, 2026

/submit

@gitgitgadget-git
Copy link

Submitted as pull.2217.git.git.1772109195114.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-git-2217/BLumia/gitk-linkfgcolor-v1

To fetch this version to local tag pr-git-2217/BLumia/gitk-linkfgcolor-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-git-2217/BLumia/gitk-linkfgcolor-v1

@gitgitgadget-git
Copy link

Junio C Hamano wrote on the Git mailing list (how to reply to this email):

"Gary Wang via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Wang Zichong <wangzichong@deepin.org>
>
> As a dark-theme user, I use the Preferences dialog to set colors
> for gitk, the only color I cannot change via that dialog is the
> link foreground color, which will lead me to use the default link
> color on a dark background that make it not really readable.
>
> This patch makes the link foreground color also configurable in the
> Gitk Preferences dialog's Color tab, so user won't need to dig into
> the code/manual to know if the link color is configurable and can
> simply set the color there.
>
> CC: Mark Levedahl <mlevedahl@gmail.com>, Paul Mackerras <paulus@samba.org>
> Signed-off-by: Wang Zichong <wangzichong@deepin.org>
> ---
>     gitk: support config the color of linkfgcolor via Gitk Preferences
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2217%2FBLumia%2Fgitk-linkfgcolor-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2217/BLumia/gitk-linkfgcolor-v1
> Pull-Request: https://github.com/git/git/pull/2217
>
>  gitk-git/gitk | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/gitk-git/gitk b/gitk-git/gitk
> index cbaaee994e..b60f140636 100755
> --- a/gitk-git/gitk
> +++ b/gitk-git/gitk
> @@ -11796,7 +11796,7 @@ proc prefspage_general {notebook} {
>  
>  proc prefspage_colors {notebook} {
>      global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
> -    global diffbgcolors
> +    global diffbgcolors linkfgcolor
>      global themeloader
>  
>      set page [create_prefs_page $notebook.colors]
> @@ -11873,6 +11873,11 @@ proc prefspage_colors {notebook} {
>          -command [list choosecolor selectbgcolor {} $page [mc "background"]]
>      grid x $page.selbgbut $page.selbgsep -sticky w
>  
> +    label $page.linkfg -padx 40 -relief sunk -background $linkfgcolor
> +    ttk::button $page.linkfgbut -text [mc "Link color"] \
> +        -command [list choosecolor linkfgcolor {} $page [mc "link color"]]
> +    grid x $page.linkfgbut $page.linkfg -sticky w
> +
>      grid columnconfigure $page 2 -weight 1
>  
>      return $page
> @@ -11880,7 +11885,7 @@ proc prefspage_colors {notebook} {
>  
>  proc prefspage_set_colorswatches {page} {
>      global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
> -    global diffbgcolors
> +    global diffbgcolors linkfgcolor
>  
>      $page.bg configure -background $bgcolor
>      $page.fg configure -background $fgcolor
> @@ -11891,6 +11896,7 @@ proc prefspage_set_colorswatches {page} {
>      $page.hunksep configure -background [lindex $diffcolors 2]
>      $page.markbgsep configure -background $markbgcolor
>      $page.selbgsep configure -background $selectbgcolor
> +    $page.linkfg configure -background $linkfgcolor
>  }
>  
>  proc prefspage_fonts {notebook} {
>
> base-commit: 7b2bccb0d58d4f24705bf985de1f4612e4cf06e5

@gitgitgadget-git
Copy link

Johannes Sixt wrote on the Git mailing list (how to reply to this email):

Am 26.02.26 um 13:33 schrieb Gary Wang via GitGitGadget:
> From: Wang Zichong <wangzichong@deepin.org>
> 
> As a dark-theme user, I use the Preferences dialog to set colors
> for gitk, the only color I cannot change via that dialog is the
> link foreground color, which will lead me to use the default link
> color on a dark background that make it not really readable.
> 
> This patch makes the link foreground color also configurable in the
> Gitk Preferences dialog's Color tab, so user won't need to dig into
> the code/manual to know if the link color is configurable and can
> simply set the color there.

Makes sense.

Our usual style is to not say "This patch does X to...", but to write in
imperative mood "Do X to...".

> 
> CC: Mark Levedahl <mlevedahl@gmail.com>, Paul Mackerras <paulus@samba.org>
> Signed-off-by: Wang Zichong <wangzichong@deepin.org>
> ---
>     gitk: support config the color of linkfgcolor via Gitk Preferences

In the subject line, perhaps:

   gitk: support link color in the Preferences dialog

> +    label $page.linkfg -padx 40 -relief sunk -background $linkfgcolor
> +    ttk::button $page.linkfgbut -text [mc "Link color"] \
> +        -command [list choosecolor linkfgcolor {} $page [mc "link color"]]

This text "link color" is used in the title of the color selection
dialog. It then reads awkwardly "Gitk: choose color for link color".
Let's just use the text "links" for this purpose, and then also just
"Links" as the label on the button.

> @@ -11891,6 +11896,7 @@ proc prefspage_set_colorswatches {page} {
>      $page.hunksep configure -background [lindex $diffcolors 2]
>      $page.markbgsep configure -background $markbgcolor
>      $page.selbgsep configure -background $selectbgcolor
> +    $page.linkfg configure -background $linkfgcolor

The variable's value is already serialized in the configuration and
needs no additional treatment. Good.

-- Hannes

@gitgitgadget-git
Copy link

User Johannes Sixt <j6t@kdbg.org> has been added to the cc: list.

@gitgitgadget-git
Copy link

Junio C Hamano wrote on the Git mailing list (how to reply to this email):

Johannes Sixt <j6t@kdbg.org> writes:

> Am 26.02.26 um 13:33 schrieb Gary Wang via GitGitGadget:
>> From: Wang Zichong <wangzichong@deepin.org>
>> 
>> As a dark-theme user, I use the Preferences dialog to set colors
>> for gitk, the only color I cannot change via that dialog is the
>> link foreground color, which will lead me to use the default link
>> color on a dark background that make it not really readable.
>> 
>> This patch makes the link foreground color also configurable in the
>> Gitk Preferences dialog's Color tab, so user won't need to dig into
>> the code/manual to know if the link color is configurable and can
>> simply set the color there.
>
> Makes sense.
>
> Our usual style is to not say "This patch does X to...", but to write in
> imperative mood "Do X to...".

A bit of tangent, but I wonder if it would help new comers if we add
what I sometimes send (e.g., a recent one found in

    https://lore.kernel.org/git/xmqq343ehu4o.fsf@gitster.g/

) somewhere more prominent, like MyFirstContribution?

>> CC: Mark Levedahl <mlevedahl@gmail.com>, Paul Mackerras <paulus@samba.org>

It is unusual to see multiple people listed on a single Cc: trailer.

>> Signed-off-by: Wang Zichong <wangzichong@deepin.org>
>> ---
>>     gitk: support config the color of linkfgcolor via Gitk Preferences
>
> In the subject line, perhaps:
>
>    gitk: support link color in the Preferences dialog
>
>> +    label $page.linkfg -padx 40 -relief sunk -background $linkfgcolor
>> +    ttk::button $page.linkfgbut -text [mc "Link color"] \
>> +        -command [list choosecolor linkfgcolor {} $page [mc "link color"]]
>
> This text "link color" is used in the title of the color selection
> dialog. It then reads awkwardly "Gitk: choose color for link color".
> Let's just use the text "links" for this purpose, and then also just
> "Links" as the label on the button.
>
>> @@ -11891,6 +11896,7 @@ proc prefspage_set_colorswatches {page} {
>>      $page.hunksep configure -background [lindex $diffcolors 2]
>>      $page.markbgsep configure -background $markbgcolor
>>      $page.selbgsep configure -background $selectbgcolor
>> +    $page.linkfg configure -background $linkfgcolor
>
> The variable's value is already serialized in the configuration and
> needs no additional treatment. Good.
>
> -- Hannes

@BLumia BLumia force-pushed the gitk-linkfgcolor branch 2 times, most recently from b427787 to f533af7 Compare February 28, 2026 04:02
@gitgitgadget-git
Copy link

Wang Zichong wrote on the Git mailing list (how to reply to this email):

>> Our usual style is to not say "This patch does X to...", but to write in
>> imperative mood "Do X to...".
>
>A bit of tangent, but I wonder if it would help new comers if we add
>what I sometimes send (e.g., a recent one found in
>
>    https://lore.kernel.org/git/xmqq343ehu4o.fsf@gitster.g/
>
>) somewhere more prominent, like MyFirstContribution?

Agree!

>>> CC: Mark Levedahl <mlevedahl@gmail.com>, Paul Mackerras <paulus@samba.org>
>
>It is unusual to see multiple people listed on a single Cc: trailer.

This usage is actually from the example provided at GitGitGadget's
landing page:

    https://gitgitgadget.github.io/

If writing multiple CC trailers is preferred, maybe we also need to update
GitGitGadget's documentation as well.

-- Gary

@gitgitgadget-git
Copy link

User Wang Zichong <wangzichong@deepin.org> has been added to the cc: list.

@BLumia
Copy link
Author

BLumia commented Feb 28, 2026

/submit

@gitgitgadget-git
Copy link

Submitted as pull.2217.v2.git.git.1772251558434.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-git-2217/BLumia/gitk-linkfgcolor-v2

To fetch this version to local tag pr-git-2217/BLumia/gitk-linkfgcolor-v2:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-git-2217/BLumia/gitk-linkfgcolor-v2

As a dark-theme user, I use the Preferences dialog to set colors
for gitk. The only color I cannot change via that dialog is the
link foreground color, which leads to using the default link color
on a dark background that makes it hard to read.

Make the link foreground color also configurable in the Gitk
Preferences dialog's Color tab, so users won't need to dig into
the code/manual to check if it is configurable and can simply set
the color there.

Signed-off-by: Wang Zichong <wangzichong@deepin.org>
---
Changelog (v3):

  * Remove CC list from commit message as suggested by Hannes
@gitgitgadget-git
Copy link

Johannes Sixt wrote on the Git mailing list (how to reply to this email):

Am 28.02.26 um 04:37 schrieb Wang Zichong:
> This usage is actually from the example provided at GitGitGadget's
> landing page:
> 
>     https://gitgitgadget.github.io/
> 
> If writing multiple CC trailers is preferred, maybe we also need to update
> GitGitGadget's documentation as well.
This page says:

"You can CC potential reviewers by adding a footer to the PR description..."

The commit message is not the PR description. Please don't add Cc lines
to the commit message. Edit the PR description on Github before you
/submit the patches with GitGitGadget.

-- Hannes

@gitgitgadget-git
Copy link

User Johannes Sixt <j6t@kdbg.org> has been added to the cc: list.

@BLumia
Copy link
Author

BLumia commented Feb 28, 2026

/submit

@gitgitgadget-git
Copy link

Submitted as pull.2217.v3.git.git.1772265584806.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-git-2217/BLumia/gitk-linkfgcolor-v3

To fetch this version to local tag pr-git-2217/BLumia/gitk-linkfgcolor-v3:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-git-2217/BLumia/gitk-linkfgcolor-v3

@gitgitgadget-git
Copy link

Wang Zichong wrote on the Git mailing list (how to reply to this email):

> This page says:
>
> "You can CC potential reviewers by adding a footer to the PR description..."
>
> The commit message is not the PR description. Please don't add Cc lines
> to the commit message. Edit the PR description on Github before you
> /submit the patches with GitGitGadget.
>
> -- Hannes

Sorry! Patch now updated with CC removed from commit message and moved to PR
description.

-- Gary

@gitgitgadget-git
Copy link

User Wang Zichong <wangzichong@deepin.org> has been added to the cc: list.

@gitgitgadget-git
Copy link

Johannes Sixt wrote on the Git mailing list (how to reply to this email):

Thanks, queued.

-- Hannes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants