threads / patch / 65079

patchgitk: support config the color of linkfgcolor via Gitk Preferences

Subject: [PATCH] gitk: support config the color of linkfgcolor via Gitk Preferences

## tl;dr

10 messages between Feb 26, 2026 and Mar 1, 2026. Diffs are folded; open one to read it.

replies: 9people: 4as markdown or json

Gary Wang via GitGitGadget· Feb 26, 2026, 12:33 UTC · lore
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(-)
Show changes to gitk-git/gitk +8 −2
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
Junio C Hamano· Feb 26, 2026, 15:25 UTC · re: Gary Wang via GitGitGadget · lore

Re: [PATCH] gitk: support config the color of linkfgcolor via Gitk Preferences

"Gary Wang via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 68 quoted lines
> 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
Johannes Sixt· Feb 27, 2026, 07:37 UTC · re: Gary Wang via GitGitGadget · lore

Re: [PATCH] gitk: support config the color of linkfgcolor via Gitk Preferences

Am 26.02.26 um 13:33 schrieb Gary Wang via GitGitGadget:
Show 11 quoted lines
> 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...".

Show 5 quoted lines
> 
> 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.

Show 5 quoted lines
> @@ -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
Junio C Hamano· Feb 27, 2026, 16:49 UTC · re: Johannes Sixt · lore

Re: [PATCH] gitk: support config the color of linkfgcolor via Gitk Preferences

Johannes Sixt <j6t@kdbg.org> writes:
Show 17 quoted lines
> 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.
Show 27 quoted lines
>> 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
Wang Zichong· Feb 28, 2026, 03:37 UTC · re: Junio C Hamano · lore

Re: [PATCH] gitk: support config the color of linkfgcolor via Gitk Preferences

Show 9 quoted lines
>> 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
Johannes Sixt· Feb 28, 2026, 07:51 UTC · re: Wang Zichong · lore

Re: [PATCH] gitk: support config the color of linkfgcolor via Gitk Preferences

Am 28.02.26 um 04:37 schrieb Wang Zichong:
Show 7 quoted lines
> 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
Wang Zichong· Feb 28, 2026, 08:02 UTC · re: Johannes Sixt · lore

Re: [PATCH] gitk: support config the color of linkfgcolor via Gitk Preferences

Show 9 quoted lines
> 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
Gary Wang via GitGitGadget· Feb 28, 2026, 04:05 UTC · re: Gary Wang via GitGitGadget · lore

[PATCH v2] gitk: support link color in the Preferences dialog

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 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.

CC: Mark Levedahl <mlevedahl@gmail.com>
CC: Paul Mackerras <paulus@samba.org>
CC: Johannes Sixt <j6t@kdbg.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-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2217/BLumia/gitk-linkfgcolor-v2
Pull-Request: https://github.com/git/git/pull/2217
Range-diff vs v1:
 1:  d5d8897fbb ! 1:  f533af7ac5 gitk: support config the color of linkfgcolor via Gitk Preferences
     @@ Metadata
      Author: Wang Zichong <wangzichong@deepin.org>
      
       ## Commit message ##
     -    gitk: support config the color of linkfgcolor via Gitk Preferences
     +    gitk: support link color in the Preferences dialog
      
          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.
     +    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.
      
     -    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.
     +    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.
      
     -    CC: Mark Levedahl <mlevedahl@gmail.com>, Paul Mackerras <paulus@samba.org>
     +    CC: Mark Levedahl <mlevedahl@gmail.com>
     +    CC: Paul Mackerras <paulus@samba.org>
     +    CC: Johannes Sixt <j6t@kdbg.org>
          Signed-off-by: Wang Zichong <wangzichong@deepin.org>
     +    ---
     +    Changelog (v2):
     +
     +      * reword commit message as suggesed by Johannes
     +      * Rename button text from "link color" to "link" as suggested
     +        by Johannes
      
       ## gitk-git/gitk ##
      @@ gitk-git/gitk: proc prefspage_general {notebook} {
     @@ gitk-git/gitk: proc prefspage_colors {notebook} {
           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"]]
     ++    ttk::button $page.linkfgbut -text [mc "Link"] \
     ++        -command [list choosecolor linkfgcolor {} $page [mc "link"]]
      +    grid x $page.linkfgbut $page.linkfg -sticky w
      +
           grid columnconfigure $page 2 -weight 1
Changelog (v2):
  * reword commit message as suggesed by Johannes
  * Rename button text from "link color" to "link" as suggested
    by Johannes
---
 gitk-git/gitk | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Show changes to gitk-git/gitk +8 −2
diff --git a/gitk-git/gitk b/gitk-git/gitk
index cbaaee994e..1c289174d5 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"] \
+        -command [list choosecolor linkfgcolor {} $page [mc "link"]]
+    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
Gary Wang via GitGitGadget· Feb 28, 2026, 07:59 UTC · re: Gary Wang via GitGitGadget · lore

[PATCH v3] gitk: support link color in the Preferences dialog

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 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>
---
    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-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2217/BLumia/gitk-linkfgcolor-v3
Pull-Request: https://github.com/git/git/pull/2217
Range-diff vs v2:
 1:  f533af7ac5 ! 1:  a2be1c0441 gitk: support link color in the Preferences dialog
     @@ Commit message
          the code/manual to check if it is configurable and can simply set
          the color there.
      
     -    CC: Mark Levedahl <mlevedahl@gmail.com>
     -    CC: Paul Mackerras <paulus@samba.org>
     -    CC: Johannes Sixt <j6t@kdbg.org>
          Signed-off-by: Wang Zichong <wangzichong@deepin.org>
          ---
     -    Changelog (v2):
     +    Changelog (v3):
      
     -      * reword commit message as suggesed by Johannes
     -      * Rename button text from "link color" to "link" as suggested
     -        by Johannes
     +      * Remove CC list from commit message as suggested by Hannes
      
       ## gitk-git/gitk ##
      @@ gitk-git/gitk: proc prefspage_general {notebook} {
Changelog (v3):
  * Remove CC list from commit message as suggested by Hannes
---
 gitk-git/gitk | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Show changes to gitk-git/gitk +8 −2
diff --git a/gitk-git/gitk b/gitk-git/gitk
index cbaaee994e..1c289174d5 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"] \
+        -command [list choosecolor linkfgcolor {} $page [mc "link"]]
+    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

← back to recent threads