{"thread":{"id":"66651","subject":"[PATCH] gitk: add cherry-pick -x context menu action","startedAt":"2026-10-24T09:40:09Z","lastAt":"2026-10-24T16:50:18Z","messageCount":3,"participants":["Ralf Habacker","Johannes Sixt","Kristoffer Haugsbakk"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"556146","messageId":"84e29b80-e219-44ed-b98a-b224d7c264d6@freenet.de","threadId":"66651","inReplyTo":null,"subject":"[PATCH] gitk: add cherry-pick -x context menu action","fromName":"Ralf Habacker","fromEmail":"ralf.habacker@freenet.de","sentAt":"2026-10-24T09:40:09Z","receivedAt":"2026-10-24T09:40:09Z","isPatch":true,"sender":{"key":"ralf.habacker@freenet.de","avatar":null},"body":"From b42c14732770444652179e96a61022fe450e6615 Mon Sep 17 00:00:00 2001\nFrom: Ralf Habacker <ralf.habacker@freenet.de>\nDate: Tue, 26 May 2026 22:55:47 +0200\nSubject: [PATCH] gitk: add cherry-pick -x context menu action\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\nFor example, this command is very useful for cherry-picking\ncommits into a stable branch using a reference—something that\notherwise can only be done from the command line.\n\nSigned-off-by: Ralf Habacker <ralf.habacker@freenet.de>\n---\n gitk-git/gitk        | 15 ++++++++++-----\n gitk-git/po/bg.po    |  3 +++\n gitk-git/po/ca.po    |  3 +++\n gitk-git/po/de.po    |  3 +++\n gitk-git/po/es.po    |  3 +++\n gitk-git/po/fr.po    |  3 +++\n gitk-git/po/hu.po    |  3 +++\n gitk-git/po/it.po    |  3 +++\n gitk-git/po/ja.po    |  3 +++\n gitk-git/po/pt_br.po |  3 +++\n gitk-git/po/pt_pt.po |  3 +++\n gitk-git/po/ru.po    |  3 +++\n gitk-git/po/sv.po    |  3 +++\n gitk-git/po/ta.po    |  3 +++\n gitk-git/po/vi.po    |  3 +++\n gitk-git/po/zh_cn.po |  3 +++\n 16 files changed, 55 insertions(+), 5 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 9506739c50..5d9c781778 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -2859,6 +2859,7 @@ proc makewindow {} {\n         {mc \"Write commit to file\" command writecommit}\n         {mc \"Create new branch\" command mkbranch}\n         {mc \"Cherry-pick this commit\" command cherrypick}\n+        {mc \"Cherry-pick this commit with -x\" command {cherrypick 1}}\n         {mc \"Reset HEAD branch to here\" command resethead}\n         {mc \"Mark this commit\" command markhere}\n         {mc \"Return to mark\" command gotomark}\n@@ -9167,13 +9168,13 @@ proc rowmenu {x y id} {\n     if {$id ne $nullid && $id ne $nullid2} {\n         set menu $rowctxmenu\n         if {$mainhead ne {}} {\n-            $menu entryconfigure 8 -label [mc \"Reset %s branch to here\" $mainhead] -state normal\n+            $menu entryconfigure 9 -label [mc \"Reset %s branch to here\" $mainhead] -state normal\n         } else {\n-            $menu entryconfigure 8 -label [mc \"Detached head: can't reset\" $mainhead] -state disabled\n+            $menu entryconfigure 9 -label [mc \"Detached head: can't reset\" $mainhead] -state disabled\n         }\n-        $menu entryconfigure 10 -state $mstate\n         $menu entryconfigure 11 -state $mstate\n         $menu entryconfigure 12 -state $mstate\n+        $menu entryconfigure 13 -state $mstate\n     } else {\n         set menu $fakerowmenu\n     }\n@@ -9881,7 +9882,7 @@ proc exec_citool {tool_args {baseid {}}} {\n     array set env $save_env\n }\n \n-proc cherrypick {} {\n+proc cherrypick {{withx 0}} {\n     global rowmenuid curview\n     global mainhead mainheadid\n     global gitdir\n@@ -9898,7 +9899,11 @@ proc cherrypick {} {\n     update\n     # Unfortunately git-cherry-pick writes stuff to stderr even when\n     # no error occurs, and exec takes that as an indication of error...\n-    if {[catch {safe_exec [list sh -c \"git cherry-pick -r $rowmenuid 2>&1\"]} err]} {\n+        set xopt \"\"\n+    if {$withx} {\n+        set xopt \" -x\"\n+    }\n+    if {[catch {safe_exec [list sh -c \"git cherry-pick -r$xopt $rowmenuid 2>&1\"]} err]} {\n         notbusy cherrypick\n         if {[regexp -line \\\n                  {Entry '(.*)' (would be overwritten by merge|not uptodate)} \\\ndiff --git a/gitk-git/po/bg.po b/gitk-git/po/bg.po\nindex 3521fdbeb4..15615fc1fa 100644\n--- a/gitk-git/po/bg.po\n+++ b/gitk-git/po/bg.po\n@@ -223,6 +223,9 @@ msgstr \"Създаване на нов клон\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Отбиране на това подаване\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"Привеждане на върха на клона към текущото подаване\"\ndiff --git a/gitk-git/po/ca.po b/gitk-git/po/ca.po\nindex d588d0990f..b8510407ec 100644\n--- a/gitk-git/po/ca.po\n+++ b/gitk-git/po/ca.po\n@@ -219,6 +219,9 @@ msgstr \"Crea una branca nova\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Recull aquesta comissió com a cirera\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"Restableix la branca HEAD aquí\"\ndiff --git a/gitk-git/po/de.po b/gitk-git/po/de.po\nindex fea18fa16e..ab85962dc6 100644\n--- a/gitk-git/po/de.po\n+++ b/gitk-git/po/de.po\n@@ -217,6 +217,9 @@ msgstr \"Neuen Zweig erstellen\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Diese Version pflücken\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"HEAD-Zweig auf diese Version zurücksetzen\"\ndiff --git a/gitk-git/po/es.po b/gitk-git/po/es.po\nindex 881738e9e6..c5edd28860 100644\n--- a/gitk-git/po/es.po\n+++ b/gitk-git/po/es.po\n@@ -224,6 +224,9 @@ msgstr \"Crear nueva rama\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Añadir esta revisión a la rama actual (cherry-pick)\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"Traer la rama HEAD aquí\"\ndiff --git a/gitk-git/po/fr.po b/gitk-git/po/fr.po\nindex f1c54b6b6a..3aa4ac0049 100644\n--- a/gitk-git/po/fr.po\n+++ b/gitk-git/po/fr.po\n@@ -223,6 +223,9 @@ msgstr \"Créer une nouvelle branche\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Cueillir (cherry-pick) ce commit\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"Réinitialiser la branche HEAD vers cet état\"\ndiff --git a/gitk-git/po/hu.po b/gitk-git/po/hu.po\nindex 9ab3f9617d..0160330bbf 100644\n--- a/gitk-git/po/hu.po\n+++ b/gitk-git/po/hu.po\n@@ -216,6 +216,9 @@ msgstr \"Új branch készítése\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Cherry-pick erre a commitra\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"HEAD branch újraindítása ide\"\ndiff --git a/gitk-git/po/it.po b/gitk-git/po/it.po\nindex aa34a34280..1b013c9120 100644\n--- a/gitk-git/po/it.po\n+++ b/gitk-git/po/it.po\n@@ -217,6 +217,9 @@ msgstr \"Crea un nuovo ramo\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Porta questa revisione in cima al ramo attuale\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"Aggiorna il ramo HEAD a questa revisione\"\ndiff --git a/gitk-git/po/ja.po b/gitk-git/po/ja.po\nindex 2c40b76dc0..bfc0754f27 100644\n--- a/gitk-git/po/ja.po\n+++ b/gitk-git/po/ja.po\n@@ -223,6 +223,9 @@ msgstr \"新規ブランチ生成\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"このコミットをチェリーピックする\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"ブランチのHEADをここにリセットする\"\ndiff --git a/gitk-git/po/pt_br.po b/gitk-git/po/pt_br.po\nindex e78fb26a2e..968a2fd328 100644\n--- a/gitk-git/po/pt_br.po\n+++ b/gitk-git/po/pt_br.po\n@@ -218,6 +218,9 @@ msgstr \"Criar novo ramo\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Fazer cherry-pick desta revisão\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"Redefinir HEAD para cá\"\ndiff --git a/gitk-git/po/pt_pt.po b/gitk-git/po/pt_pt.po\nindex 66d3159d47..db71579365 100644\n--- a/gitk-git/po/pt_pt.po\n+++ b/gitk-git/po/pt_pt.po\n@@ -220,6 +220,9 @@ msgstr \"Criar novo ramo\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Efetuar cherry-pick deste commit\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"Repor ramo HEAD para aqui\"\ndiff --git a/gitk-git/po/ru.po b/gitk-git/po/ru.po\nindex e102fb7200..7a3e1d73d0 100644\n--- a/gitk-git/po/ru.po\n+++ b/gitk-git/po/ru.po\n@@ -226,6 +226,9 @@ msgstr \"Создать ветку\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Копировать этот коммит в текущую ветку\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"Установить HEAD на этот коммит\"\ndiff --git a/gitk-git/po/sv.po b/gitk-git/po/sv.po\nindex c9290625c0..7dbae72847 100644\n--- a/gitk-git/po/sv.po\n+++ b/gitk-git/po/sv.po\n@@ -223,6 +223,9 @@ msgstr \"Skapa ny gren\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Plocka denna incheckning\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"Återställ HEAD-grenen hit\"\ndiff --git a/gitk-git/po/ta.po b/gitk-git/po/ta.po\nindex 9b9176a4aa..ddf8b12e89 100644\n--- a/gitk-git/po/ta.po\n+++ b/gitk-git/po/ta.po\n@@ -220,6 +220,9 @@ msgstr \"புதிய கிளையை உருவாக்கு\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"கனி-எடு இந்த உறுதிமொழி\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"தலை கிளையை இங்கே மீட்டமை\"\ndiff --git a/gitk-git/po/vi.po b/gitk-git/po/vi.po\nindex 52c9d09a09..81e031d96d 100644\n--- a/gitk-git/po/vi.po\n+++ b/gitk-git/po/vi.po\n@@ -217,6 +217,9 @@ msgstr \"Tạo nhánh mới\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"Cherry-pick lần chuyển giao này\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"Đặt lại HEAD của nhánh vào đây\"\ndiff --git a/gitk-git/po/zh_cn.po b/gitk-git/po/zh_cn.po\nindex 71a9878318..97dd066b49 100644\n--- a/gitk-git/po/zh_cn.po\n+++ b/gitk-git/po/zh_cn.po\n@@ -214,6 +214,9 @@ msgstr \"创建新分支\"\n \n msgid \"Cherry-pick this commit\"\n msgstr \"在此提交运用补丁(cherry-pick)命令\"\n+msgid \"Cherry-pick this commit with -x\"\n+msgstr \"\"\n+\n \n msgid \"Reset HEAD branch to here\"\n msgstr \"将分支头(HEAD)重置到此处\"\n-- \n2.51.0\n\n"},{"id":"556170","messageId":"75b5e0d7-9608-4e2f-a60c-d278af5b2e85@kdbg.org","threadId":"66651","inReplyTo":"84e29b80-e219-44ed-b98a-b224d7c264d6@freenet.de","subject":"Re: [PATCH] gitk: add cherry-pick -x context menu action","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2026-10-24T15:52:07Z","receivedAt":"2026-10-24T15:52:07Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Please paste the contents of the format-patch output into the email; do\nnot send it as attachment. See the format-patch man page[1] how to set\nup a mail client in a way that does not mangle the patch text.\n\n[1] https://git-scm.com/docs/git-format-patch#_mua_specific_hints\n\nAm 24.10.26 um 11:40 schrieb Ralf Habacker:\n> For example, this command is very useful for cherry-picking\n> commits into a stable branch using a reference—something that\n\nWe need an en-dash or em-dash (two or three dashes) between \"reference\"\nand \"something\" to give the sentence the correct meaning.\n\n> otherwise can only be done from the command line.\n> \n\nPersonally, I use cherry-pick -x so rarely that I have no problem going\nto the command line for those cases. Since the context menu is already\nvery long, I am hesitant to add a small variation of a command that is\nalready present (and very useful).\n\nAre others interested in this feature?\n\nBelow some comments on the implementation just in case there are.\n\n> Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>\n> ---\n>  gitk-git/gitk        | 15 ++++++++++-----\n>  gitk-git/po/bg.po    |  3 +++\n>  gitk-git/po/ca.po    |  3 +++\n>  gitk-git/po/de.po    |  3 +++\n>  gitk-git/po/es.po    |  3 +++\n>  gitk-git/po/fr.po    |  3 +++\n>  gitk-git/po/hu.po    |  3 +++\n>  gitk-git/po/it.po    |  3 +++\n>  gitk-git/po/ja.po    |  3 +++\n>  gitk-git/po/pt_br.po |  3 +++\n>  gitk-git/po/pt_pt.po |  3 +++\n>  gitk-git/po/ru.po    |  3 +++\n>  gitk-git/po/sv.po    |  3 +++\n>  gitk-git/po/ta.po    |  3 +++\n>  gitk-git/po/vi.po    |  3 +++\n>  gitk-git/po/zh_cn.po |  3 +++\n\nPlease do not edit the translation files.\n\n>  16 files changed, 55 insertions(+), 5 deletions(-)\n> \n> diff --git a/gitk-git/gitk b/gitk-git/gitk\n> index 9506739c50..5d9c781778 100755\n> --- a/gitk-git/gitk\n> +++ b/gitk-git/gitk\n> @@ -2859,6 +2859,7 @@ proc makewindow {} {\n>          {mc \"Write commit to file\" command writecommit}\n>          {mc \"Create new branch\" command mkbranch}\n>          {mc \"Cherry-pick this commit\" command cherrypick}\n> +        {mc \"Cherry-pick this commit with -x\" command {cherrypick 1}}\n\nWe are in a UI here. Avoid jargon. (\"What is -x??\") How about:\n\n\t\"Cherry-pick with cross-reference\"\n\n>          {mc \"Reset HEAD branch to here\" command resethead}\n>          {mc \"Mark this commit\" command markhere}\n>          {mc \"Return to mark\" command gotomark}\n> @@ -9167,13 +9168,13 @@ proc rowmenu {x y id} {\n>      if {$id ne $nullid && $id ne $nullid2} {\n>          set menu $rowctxmenu\n>          if {$mainhead ne {}} {\n> -            $menu entryconfigure 8 -label [mc \"Reset %s branch to here\" $mainhead] -state normal\n> +            $menu entryconfigure 9 -label [mc \"Reset %s branch to here\" $mainhead] -state normal\n>          } else {\n> -            $menu entryconfigure 8 -label [mc \"Detached head: can't reset\" $mainhead] -state disabled\n> +            $menu entryconfigure 9 -label [mc \"Detached head: can't reset\" $mainhead] -state disabled\n>          }\n> -        $menu entryconfigure 10 -state $mstate\n>          $menu entryconfigure 11 -state $mstate\n>          $menu entryconfigure 12 -state $mstate\n> +        $menu entryconfigure 13 -state $mstate\n>      } else {\n>          set menu $fakerowmenu\n>      }\n> @@ -9881,7 +9882,7 @@ proc exec_citool {tool_args {baseid {}}} {\n>      array set env $save_env\n>  }\n>  \n> -proc cherrypick {} {\n> +proc cherrypick {{withx 0}} {\n\nIf you make the default value of the parameter \"-r\", then the new caller\ncan just pass \"-x\" and we do not need the conditional below. (Also\nrename the parameter.)\n\n>      global rowmenuid curview\n>      global mainhead mainheadid\n>      global gitdir\n> @@ -9898,7 +9899,11 @@ proc cherrypick {} {\n>      update\n>      # Unfortunately git-cherry-pick writes stuff to stderr even when\n>      # no error occurs, and exec takes that as an indication of error...\n> -    if {[catch {safe_exec [list sh -c \"git cherry-pick -r $rowmenuid 2>&1\"]} err]} {\n> +        set xopt \"\"\n> +    if {$withx} {\n> +        set xopt \" -x\"\n> +    }\n> +    if {[catch {safe_exec [list sh -c \"git cherry-pick -r$xopt $rowmenuid 2>&1\"]} err]} {\n\n-r and -x are opposites. While the last one wins, it would be great if\nthe one option that is not used would not remain in the command.\n\n>          notbusy cherrypick\n>          if {[regexp -line \\\n>                   {Entry '(.*)' (would be overwritten by merge|not uptodate)} \\\n\n-- Hannes\n\n\n"},{"id":"556176","messageId":"5771ee92-7414-496d-97d9-c084f4ee2ec8@app.fastmail.com","threadId":"66651","inReplyTo":"75b5e0d7-9608-4e2f-a60c-d278af5b2e85@kdbg.org","subject":"Re: [PATCH] gitk: add cherry-pick -x context menu action","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-10-24T16:50:18Z","receivedAt":"2026-10-24T16:50:18Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Sat, Oct 24, 2026, at 17:52, Johannes Sixt wrote:\n>[snip]\n>\n> Am 24.10.26 um 11:40 schrieb Ralf Habacker:\n>> For example, this command is very useful for cherry-picking\n>> commits into a stable branch using a reference—something that\n>\n> We need an en-dash or em-dash (two or three dashes) between \"reference\"\n> and \"something\" to give the sentence the correct meaning.\n\nThat is an em-dash. I guess 2–3 hyphens are\nwanted instead since they take up the expected\namount of space in a monospace font.\n\nPersonally, I think a comma would work\ntoo in that context.\n\n>[snip]\n> -- Hannes\n\nSent from mobile again\n\n"}]}