{"thread":{"id":"66669","subject":"gitk: add cherry-pick with cross-reference action","startedAt":"2026-10-26T18:42:27Z","lastAt":"2026-10-27T09:55:26Z","messageCount":2,"participants":["Ralf Habacker","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"556389","messageId":"57d4f046-26fc-4dd3-8a90-4132c5941ca4@freenet.de","threadId":"66669","inReplyTo":null,"subject":"gitk: add cherry-pick with cross-reference action","fromName":"Ralf Habacker","fromEmail":"ralf.habacker@freenet.de","sentAt":"2026-10-26T18:42:27Z","receivedAt":"2026-10-26T18:42:27Z","isPatch":false,"sender":{"key":"ralf.habacker@freenet.de","avatar":null},"body":"From ae2217025407ff91f3ea3332f94d5b0bdcd01e70 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 with cross-reference action\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\nAdd a context-menu action to cherry-pick a commit with a reference to\nthe original commit in the commit message.\n\nThis commit closes a gap in gitk’s GUI workflow for projects that\nfor example require backported commits to remain traceable to their\noriginals.\n\nSigned-off-by: Ralf Habacker <ralf.habacker@freenet.de>\n---\n gitk-git/gitk | 11 ++++++-----\n 1 file changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 9506739c50..0c7db0a4d9 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 with cross-reference\" command {cherrypick -x}}\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 {{option \"-r\"}} {\n     global rowmenuid curview\n     global mainhead mainheadid\n     global gitdir\n@@ -9898,7 +9899,7 @@ 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+    if {[catch {safe_exec [list sh -c \"git cherry-pick $option $rowmenuid 2>&1\"]} err]} {\n         notbusy cherrypick\n         if {[regexp -line \\\n                  {Entry '(.*)' (would be overwritten by merge|not uptodate)} \\\n-- \n2.54.0\n\n\n"},{"id":"556459","messageId":"004525db-3029-4e99-b93c-ff7ff24e3b4a@kdbg.org","threadId":"66669","inReplyTo":"57d4f046-26fc-4dd3-8a90-4132c5941ca4@freenet.de","subject":"Re: gitk: add cherry-pick with cross-reference action","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2026-10-27T09:55:26Z","receivedAt":"2026-10-27T09:55:26Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 26.10.26 um 19:42 schrieb Ralf Habacker:\n> Add a context-menu action to cherry-pick a commit with a reference to\n> the original commit in the commit message.\n> \n> This commit closes a gap in gitk’s GUI workflow for projects that\n> for example require backported commits to remain traceable to their\n> originals.\n\nThe patch text is looking good. I picked up the patch and pushed it out\nas branch rh/cherry-pick-x to https://github.com/j6t/gitk for others to\nconsume. But, as I said, I would like to hear more voices that this is a\ngood thing to include.\n\n-- Hannes\n\n\n"}]}