Skip to contentSkip to conversation

gitk: support config the color of linkfgcolor via Gitk Preferences

PATCH In review Gary Wang via GitGitGadget 4 participants 10 messages Feb 26 – Mar 1

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitk: support config the color of linkfgcolor via Gitk Preferences

From: Wang Zichong <[email protected]>

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 <[email protected]>, Paul Mackerras <[email protected]>

---
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(-)
gitk-git/gitk +8 -2
index cbaaee994e..b60f140636 100755
@@ -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

Signature · 1 line
gitgitgadget
#1 lore raw
Quoted 68 lines · Gary Wang via GitGitGadget

From: Wang Zichong <[email protected]>

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 <[email protected]>, Paul Mackerras <[email protected]>

---
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(-)
gitk-git/gitk +8 -2
index cbaaee994e..b60f140636 100755
@@ -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

#2 lore raw
In reply to Gary Wang via GitGitGadget

Am 26.02.26 um 13:33 schrieb Gary Wang via GitGitGadget:

Quoted 11 lines

From: Wang Zichong <[email protected]>

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

Quoted 5 lines
CC Mark Levedahl <[email protected]>, Paul Mackerras <[email protected]>

---
gitk: support config the color of linkfgcolor via Gitk Preferences

In the subject line, perhaps:

gitk: support link color in the Preferences dialog

gitk-git/gitk proc prefspage_colors {notebook} { · line 11878

Quoted 3 lines
gitk-git/gitk +3 -0
+    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.

gitk-git/gitk proc prefspage_set_colorswatches {page} { · line 11899

Quoted 5 lines
gitk-git/gitk +1 -0
@@ -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

#3 lore raw
Quoted 13 lines · Johannes Sixt

Am 26.02.26 um 13:33 schrieb Gary Wang via GitGitGadget:

Quoted 11 lines

From: Wang Zichong <[email protected]>

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.

Quoted 4 lines

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/[email protected]/

) somewhere more prominent, like MyFirstContribution?

Quoted 1 line
Quoted 1 line
CC Mark Levedahl <[email protected]>, Paul Mackerras <[email protected]>

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

Quoted 27 lines
Quoted 3 lines

---
gitk: support config the color of linkfgcolor via Gitk Preferences

In the subject line, perhaps:

gitk: support link color in the Preferences dialog

gitk-git/gitk proc prefspage_colors {notebook} { · line 11878

Quoted 3 lines
gitk-git/gitk +3 -0
+    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.

gitk-git/gitk proc prefspage_set_colorswatches {page} { · line 11899

Quoted 5 lines
gitk-git/gitk +1 -0
@@ -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

#4 lore raw
Quoted 9 lines
Quoted 2 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/[email protected]/

) somewhere more prominent, like MyFirstContribution?

Agree!

Quoted 3 lines
Quoted 1 line
Quoted 1 line
CC Mark Levedahl <[email protected]>, Paul Mackerras <[email protected]>

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

#7 lore raw

PATCH v2 1/1 gitk: support link color in the Preferences dialog

In reply to Gary Wang via GitGitGadget

From: Wang Zichong <[email protected]>

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 <[email protected]>
CC Paul Mackerras <[email protected]>
CC Johannes Sixt <[email protected]>

---
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 <[email protected]>

## 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 <[email protected]>, Paul Mackerras <[email protected]>
+ CC: Mark Levedahl <[email protected]>
+ CC: Paul Mackerras <[email protected]>
+ CC: Johannes Sixt <[email protected]>

+ ---
+ 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(-)
gitk-git/gitk +8 -2
index cbaaee994e..1c289174d5 100755
@@ -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

Signature · 1 line
gitgitgadget
#5 lore raw
In reply to Wang Zichong

Am 28.02.26 um 04:37 schrieb Wang Zichong:

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

#8 lore raw

PATCH v3 1/1 gitk: support link color in the Preferences dialog

In reply to Gary Wang via GitGitGadget

From: Wang Zichong <[email protected]>

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.

---
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 <[email protected]>
- CC: Paul Mackerras <[email protected]>
- CC: Johannes Sixt <[email protected]>

---
- 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(-)
gitk-git/gitk +8 -2
index cbaaee994e..1c289174d5 100755
@@ -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

Signature · 1 line
gitgitgadget
#6 lore raw
In reply to Johannes Sixt
Quoted 9 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