From: Ralf Habacker <ralf.habacker@freenet.de>
To: git@vger.kernel.org
Cc: Ralf Habacker <ralf.habacker@freenet.de>
Subject: [PATCH] gitk: add cherry-pick -x context menu action
Date: Sat, 24 Oct 2026 11:40:09 +0200 [thread overview]
Message-ID: <84e29b80-e219-44ed-b98a-b224d7c264d6@freenet.de> (raw)
[-- Attachment #2: 0001-gitk-add-cherry-pick-x-context-menu-action.patch --]
[-- Type: text/x-patch, Size: 9638 bytes --]
From b42c14732770444652179e96a61022fe450e6615 Mon Sep 17 00:00:00 2001
From: Ralf Habacker <ralf.habacker@freenet.de>
Date: Tue, 26 May 2026 22:55:47 +0200
Subject: [PATCH] gitk: add cherry-pick -x context menu action
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
For example, this command is very useful for cherry-picking
commits into a stable branch using a reference—something that
otherwise can only be done from the command line.
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
---
gitk-git/gitk | 15 ++++++++++-----
gitk-git/po/bg.po | 3 +++
gitk-git/po/ca.po | 3 +++
gitk-git/po/de.po | 3 +++
gitk-git/po/es.po | 3 +++
gitk-git/po/fr.po | 3 +++
gitk-git/po/hu.po | 3 +++
gitk-git/po/it.po | 3 +++
gitk-git/po/ja.po | 3 +++
gitk-git/po/pt_br.po | 3 +++
gitk-git/po/pt_pt.po | 3 +++
gitk-git/po/ru.po | 3 +++
gitk-git/po/sv.po | 3 +++
gitk-git/po/ta.po | 3 +++
gitk-git/po/vi.po | 3 +++
gitk-git/po/zh_cn.po | 3 +++
16 files changed, 55 insertions(+), 5 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 9506739c50..5d9c781778 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2859,6 +2859,7 @@ proc makewindow {} {
{mc "Write commit to file" command writecommit}
{mc "Create new branch" command mkbranch}
{mc "Cherry-pick this commit" command cherrypick}
+ {mc "Cherry-pick this commit with -x" command {cherrypick 1}}
{mc "Reset HEAD branch to here" command resethead}
{mc "Mark this commit" command markhere}
{mc "Return to mark" command gotomark}
@@ -9167,13 +9168,13 @@ proc rowmenu {x y id} {
if {$id ne $nullid && $id ne $nullid2} {
set menu $rowctxmenu
if {$mainhead ne {}} {
- $menu entryconfigure 8 -label [mc "Reset %s branch to here" $mainhead] -state normal
+ $menu entryconfigure 9 -label [mc "Reset %s branch to here" $mainhead] -state normal
} else {
- $menu entryconfigure 8 -label [mc "Detached head: can't reset" $mainhead] -state disabled
+ $menu entryconfigure 9 -label [mc "Detached head: can't reset" $mainhead] -state disabled
}
- $menu entryconfigure 10 -state $mstate
$menu entryconfigure 11 -state $mstate
$menu entryconfigure 12 -state $mstate
+ $menu entryconfigure 13 -state $mstate
} else {
set menu $fakerowmenu
}
@@ -9881,7 +9882,7 @@ proc exec_citool {tool_args {baseid {}}} {
array set env $save_env
}
-proc cherrypick {} {
+proc cherrypick {{withx 0}} {
global rowmenuid curview
global mainhead mainheadid
global gitdir
@@ -9898,7 +9899,11 @@ proc cherrypick {} {
update
# Unfortunately git-cherry-pick writes stuff to stderr even when
# no error occurs, and exec takes that as an indication of error...
- if {[catch {safe_exec [list sh -c "git cherry-pick -r $rowmenuid 2>&1"]} err]} {
+ set xopt ""
+ if {$withx} {
+ set xopt " -x"
+ }
+ if {[catch {safe_exec [list sh -c "git cherry-pick -r$xopt $rowmenuid 2>&1"]} err]} {
notbusy cherrypick
if {[regexp -line \
{Entry '(.*)' (would be overwritten by merge|not uptodate)} \
diff --git a/gitk-git/po/bg.po b/gitk-git/po/bg.po
index 3521fdbeb4..15615fc1fa 100644
--- a/gitk-git/po/bg.po
+++ b/gitk-git/po/bg.po
@@ -223,6 +223,9 @@ msgstr "Създаване на нов клон"
msgid "Cherry-pick this commit"
msgstr "Отбиране на това подаване"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "Привеждане на върха на клона към текущото подаване"
diff --git a/gitk-git/po/ca.po b/gitk-git/po/ca.po
index d588d0990f..b8510407ec 100644
--- a/gitk-git/po/ca.po
+++ b/gitk-git/po/ca.po
@@ -219,6 +219,9 @@ msgstr "Crea una branca nova"
msgid "Cherry-pick this commit"
msgstr "Recull aquesta comissió com a cirera"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "Restableix la branca HEAD aquí"
diff --git a/gitk-git/po/de.po b/gitk-git/po/de.po
index fea18fa16e..ab85962dc6 100644
--- a/gitk-git/po/de.po
+++ b/gitk-git/po/de.po
@@ -217,6 +217,9 @@ msgstr "Neuen Zweig erstellen"
msgid "Cherry-pick this commit"
msgstr "Diese Version pflücken"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "HEAD-Zweig auf diese Version zurücksetzen"
diff --git a/gitk-git/po/es.po b/gitk-git/po/es.po
index 881738e9e6..c5edd28860 100644
--- a/gitk-git/po/es.po
+++ b/gitk-git/po/es.po
@@ -224,6 +224,9 @@ msgstr "Crear nueva rama"
msgid "Cherry-pick this commit"
msgstr "Añadir esta revisión a la rama actual (cherry-pick)"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "Traer la rama HEAD aquí"
diff --git a/gitk-git/po/fr.po b/gitk-git/po/fr.po
index f1c54b6b6a..3aa4ac0049 100644
--- a/gitk-git/po/fr.po
+++ b/gitk-git/po/fr.po
@@ -223,6 +223,9 @@ msgstr "Créer une nouvelle branche"
msgid "Cherry-pick this commit"
msgstr "Cueillir (cherry-pick) ce commit"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "Réinitialiser la branche HEAD vers cet état"
diff --git a/gitk-git/po/hu.po b/gitk-git/po/hu.po
index 9ab3f9617d..0160330bbf 100644
--- a/gitk-git/po/hu.po
+++ b/gitk-git/po/hu.po
@@ -216,6 +216,9 @@ msgstr "Új branch készítése"
msgid "Cherry-pick this commit"
msgstr "Cherry-pick erre a commitra"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "HEAD branch újraindítása ide"
diff --git a/gitk-git/po/it.po b/gitk-git/po/it.po
index aa34a34280..1b013c9120 100644
--- a/gitk-git/po/it.po
+++ b/gitk-git/po/it.po
@@ -217,6 +217,9 @@ msgstr "Crea un nuovo ramo"
msgid "Cherry-pick this commit"
msgstr "Porta questa revisione in cima al ramo attuale"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "Aggiorna il ramo HEAD a questa revisione"
diff --git a/gitk-git/po/ja.po b/gitk-git/po/ja.po
index 2c40b76dc0..bfc0754f27 100644
--- a/gitk-git/po/ja.po
+++ b/gitk-git/po/ja.po
@@ -223,6 +223,9 @@ msgstr "新規ブランチ生成"
msgid "Cherry-pick this commit"
msgstr "このコミットをチェリーピックする"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "ブランチのHEADをここにリセットする"
diff --git a/gitk-git/po/pt_br.po b/gitk-git/po/pt_br.po
index e78fb26a2e..968a2fd328 100644
--- a/gitk-git/po/pt_br.po
+++ b/gitk-git/po/pt_br.po
@@ -218,6 +218,9 @@ msgstr "Criar novo ramo"
msgid "Cherry-pick this commit"
msgstr "Fazer cherry-pick desta revisão"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "Redefinir HEAD para cá"
diff --git a/gitk-git/po/pt_pt.po b/gitk-git/po/pt_pt.po
index 66d3159d47..db71579365 100644
--- a/gitk-git/po/pt_pt.po
+++ b/gitk-git/po/pt_pt.po
@@ -220,6 +220,9 @@ msgstr "Criar novo ramo"
msgid "Cherry-pick this commit"
msgstr "Efetuar cherry-pick deste commit"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "Repor ramo HEAD para aqui"
diff --git a/gitk-git/po/ru.po b/gitk-git/po/ru.po
index e102fb7200..7a3e1d73d0 100644
--- a/gitk-git/po/ru.po
+++ b/gitk-git/po/ru.po
@@ -226,6 +226,9 @@ msgstr "Создать ветку"
msgid "Cherry-pick this commit"
msgstr "Копировать этот коммит в текущую ветку"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "Установить HEAD на этот коммит"
diff --git a/gitk-git/po/sv.po b/gitk-git/po/sv.po
index c9290625c0..7dbae72847 100644
--- a/gitk-git/po/sv.po
+++ b/gitk-git/po/sv.po
@@ -223,6 +223,9 @@ msgstr "Skapa ny gren"
msgid "Cherry-pick this commit"
msgstr "Plocka denna incheckning"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "Återställ HEAD-grenen hit"
diff --git a/gitk-git/po/ta.po b/gitk-git/po/ta.po
index 9b9176a4aa..ddf8b12e89 100644
--- a/gitk-git/po/ta.po
+++ b/gitk-git/po/ta.po
@@ -220,6 +220,9 @@ msgstr "புதிய கிளையை உருவாக்கு"
msgid "Cherry-pick this commit"
msgstr "கனி-எடு இந்த உறுதிமொழி"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "தலை கிளையை இங்கே மீட்டமை"
diff --git a/gitk-git/po/vi.po b/gitk-git/po/vi.po
index 52c9d09a09..81e031d96d 100644
--- a/gitk-git/po/vi.po
+++ b/gitk-git/po/vi.po
@@ -217,6 +217,9 @@ msgstr "Tạo nhánh mới"
msgid "Cherry-pick this commit"
msgstr "Cherry-pick lần chuyển giao này"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "Đặt lại HEAD của nhánh vào đây"
diff --git a/gitk-git/po/zh_cn.po b/gitk-git/po/zh_cn.po
index 71a9878318..97dd066b49 100644
--- a/gitk-git/po/zh_cn.po
+++ b/gitk-git/po/zh_cn.po
@@ -214,6 +214,9 @@ msgstr "创建新分支"
msgid "Cherry-pick this commit"
msgstr "在此提交运用补丁(cherry-pick)命令"
+msgid "Cherry-pick this commit with -x"
+msgstr ""
+
msgid "Reset HEAD branch to here"
msgstr "将分支头(HEAD)重置到此处"
--
2.51.0
next reply other threads:[~2026-10-24 9:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 9:40 Ralf Habacker [this message]
2026-10-24 15:52 ` [PATCH] gitk: add cherry-pick -x context menu action Johannes Sixt
2026-10-24 16:50 ` Kristoffer Haugsbakk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=84e29b80-e219-44ed-b98a-b224d7c264d6@freenet.de \
--to=ralf.habacker@freenet.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox