{"thread":{"id":"39883","subject":"[PATCH v4] gitk: Add a \"Copy commit summary\" command","startedAt":"2015-07-18T11:15:39Z","lastAt":"2015-08-13T19:02:33Z","messageCount":7,"participants":["Beat Bolli","Paul Mackerras"],"isPatch":true,"patchVersion":4,"patchTotal":null},"messages":[{"id":"266326","messageId":"1437218139-7031-1-git-send-email-dev+git@drbeat.li","threadId":"39883","inReplyTo":null,"subject":"[PATCH v4] gitk: Add a \"Copy commit summary\" command","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2015-07-18T11:15:39Z","receivedAt":"2015-07-18T11:15:39Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"When referring to earlier commits in commit messages or other text, one\nof the established formats is\n\n    <abbrev-sha> (\"<summary>\", <author-date>)\n\nAdd a \"Copy commit summary\" command to the context menu that puts this\ntext for the currently selected commit on the clipboard. This makes it\neasy for our users to create well-formatted commit references.\n\nThe <abbrev-sha> is produced with the %h format specifier to make it\nunique. Its length can be controlled with the gitk preference\n\"Auto-select SHA1 (length)\", or, if this preference is set to its\ndefault value (40), with the Git config setting core.abbrev.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\nCc: Paul Mackerras <paulus@samba.org>\n---\nChanges since v3:\n- consider $autosellen for the --abbrev value\n\nChanges since v2:\n- call git show to produce a unique <abbrev-sha>\n- use the short date format\n\nChanges since v1:\n- drop the \"commit \" literal in front of the <abbrev-sha>\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n gitk-git/gitk | 15 +++++++++++++++\n 1 file changed, 15 insertions(+)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 9a2daf3..d05169a 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -2617,6 +2617,7 @@ proc makewindow {} {\n \t{mc \"Diff selected -> this\" command {diffvssel 1}}\n \t{mc \"Make patch\" command mkpatch}\n \t{mc \"Create tag\" command mktag}\n+\t{mc \"Copy commit summary\" command copysummary}\n \t{mc \"Write commit to file\" command writecommit}\n \t{mc \"Create new branch\" command mkbranch}\n \t{mc \"Cherry-pick this commit\" command cherrypick}\n@@ -9341,6 +9342,20 @@ proc mktaggo {} {\n     mktagcan\n }\n \n+proc copysummary {} {\n+    global rowmenuid autosellen\n+\n+    set format \"%h (\\\"%s\\\", %ad)\"\n+    set cmd [list git show -s --pretty=format:$format --date=short]\n+    if {$autosellen < 40} {\n+        lappend cmd --abbrev=$autosellen\n+    }\n+    set summary [eval exec $cmd $rowmenuid]\n+\n+    clipboard clear\n+    clipboard append $summary\n+}\n+\n proc writecommit {} {\n     global rowmenuid wrcomtop commitinfo wrcomcmd NS\n \n-- \n2.1.4\n"},{"id":"266535","messageId":"55AE1CAB.9040404@drbeat.li","threadId":"39883","inReplyTo":"1437218139-7031-1-git-send-email-dev+git@drbeat.li","subject":"Re: [PATCH v4] gitk: Add a \"Copy commit summary\" command","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2015-07-21T10:19:23Z","receivedAt":"2015-07-21T10:19:23Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"Guys,\n\ncan I get a Yea or Nay for this patch?\n\nDoes it go in via Paul's gitk repo or directly through Junio?\n\n\nThanks,\nBeat\n\nOn 18.07.15 13:15, Beat Bolli wrote:\n> When referring to earlier commits in commit messages or other text, one\n> of the established formats is\n> \n>     <abbrev-sha> (\"<summary>\", <author-date>)\n> \n> Add a \"Copy commit summary\" command to the context menu that puts this\n> text for the currently selected commit on the clipboard. This makes it\n> easy for our users to create well-formatted commit references.\n> \n> The <abbrev-sha> is produced with the %h format specifier to make it\n> unique. Its length can be controlled with the gitk preference\n> \"Auto-select SHA1 (length)\", or, if this preference is set to its\n> default value (40), with the Git config setting core.abbrev.\n> \n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> Cc: Paul Mackerras <paulus@samba.org>\n> ---\n> Changes since v3:\n> - consider $autosellen for the --abbrev value\n> \n> Changes since v2:\n> - call git show to produce a unique <abbrev-sha>\n> - use the short date format\n> \n> Changes since v1:\n> - drop the \"commit \" literal in front of the <abbrev-sha>\n> \n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  gitk-git/gitk | 15 +++++++++++++++\n>  1 file changed, 15 insertions(+)\n> \n> diff --git a/gitk-git/gitk b/gitk-git/gitk\n> index 9a2daf3..d05169a 100755\n> --- a/gitk-git/gitk\n> +++ b/gitk-git/gitk\n> @@ -2617,6 +2617,7 @@ proc makewindow {} {\n>  \t{mc \"Diff selected -> this\" command {diffvssel 1}}\n>  \t{mc \"Make patch\" command mkpatch}\n>  \t{mc \"Create tag\" command mktag}\n> +\t{mc \"Copy commit summary\" command copysummary}\n>  \t{mc \"Write commit to file\" command writecommit}\n>  \t{mc \"Create new branch\" command mkbranch}\n>  \t{mc \"Cherry-pick this commit\" command cherrypick}\n> @@ -9341,6 +9342,20 @@ proc mktaggo {} {\n>      mktagcan\n>  }\n>  \n> +proc copysummary {} {\n> +    global rowmenuid autosellen\n> +\n> +    set format \"%h (\\\"%s\\\", %ad)\"\n> +    set cmd [list git show -s --pretty=format:$format --date=short]\n> +    if {$autosellen < 40} {\n> +        lappend cmd --abbrev=$autosellen\n> +    }\n> +    set summary [eval exec $cmd $rowmenuid]\n> +\n> +    clipboard clear\n> +    clipboard append $summary\n> +}\n> +\n>  proc writecommit {} {\n>      global rowmenuid wrcomtop commitinfo wrcomcmd NS\n>  \n> \n"},{"id":"266536","messageId":"20150721102815.GA2571@yogo.paulus.ozlabs.org","threadId":"39883","inReplyTo":"55AE1CAB.9040404@drbeat.li","subject":"Re: [PATCH v4] gitk: Add a \"Copy commit summary\" command","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2015-07-21T10:28:16Z","receivedAt":"2015-07-21T10:28:16Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Tue, Jul 21, 2015 at 12:19:23PM +0200, Beat Bolli wrote:\n> Guys,\n> \n> can I get a Yea or Nay for this patch?\n> \n> Does it go in via Paul's gitk repo or directly through Junio?\n\nI'll put it in.  It goes into my repo and from there into Junio's.\nI'm on vacation and travelling this week, so please be patient.\n\nRegards,\nPaul.\n"},{"id":"266537","messageId":"55AE1F52.80605@drbeat.li","threadId":"39883","inReplyTo":"20150721102815.GA2571@yogo.paulus.ozlabs.org","subject":"Re: [PATCH v4] gitk: Add a \"Copy commit summary\" command","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2015-07-21T10:30:42Z","receivedAt":"2015-07-21T10:30:42Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"On 21.07.15 12:28, Paul Mackerras wrote:\n> On Tue, Jul 21, 2015 at 12:19:23PM +0200, Beat Bolli wrote:\n>> Guys,\n>>\n>> can I get a Yea or Nay for this patch?\n>>\n>> Does it go in via Paul's gitk repo or directly through Junio?\n> \n> I'll put it in.  It goes into my repo and from there into Junio's.\n> I'm on vacation and travelling this week, so please be patient.\n\nNo problem, enjoy your vacation!\n\nBeat\n"},{"id":"267867","messageId":"1439326837-6126-1-git-send-email-dev+git@drbeat.li","threadId":"39883","inReplyTo":"1437218139-7031-1-git-send-email-dev+git@drbeat.li","subject":"[PATCH] gitk: adjust the menu line numbers to compensate for the new entry","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2015-08-11T21:00:37Z","receivedAt":"2015-08-11T21:00:37Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"The previous commit[1] added a new context menu entry. Therefore, the\nline numbers of the folloeing entries need to be incremented when their\ntext or state is changed.\n\n[1] <1437218139-7031-1-git-send-email-dev+git@drbeat.li>,\n    http://article.gmane.org/gmane.comp.version-control.git/274161\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\nCc: Paul Mackerras <paulus@samba.org>\n---\nPaul, feel free to squash this commit into my previous one.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n gitk-git/gitk | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex d05169a..bc0e586 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -8877,13 +8877,13 @@ proc rowmenu {x y id} {\n     if {$id ne $nullid && $id ne $nullid2} {\n \tset menu $rowctxmenu\n \tif {$mainhead ne {}} {\n-\t    $menu entryconfigure 7 -label [mc \"Reset %s branch to here\" $mainhead] -state normal\n+\t    $menu entryconfigure 8 -label [mc \"Reset %s branch to here\" $mainhead] -state normal\n \t} else {\n-\t    $menu entryconfigure 7 -label [mc \"Detached head: can't reset\" $mainhead] -state disabled\n+\t    $menu entryconfigure 8 -label [mc \"Detached head: can't reset\" $mainhead] -state disabled\n \t}\n-\t$menu entryconfigure 9 -state $mstate\n \t$menu entryconfigure 10 -state $mstate\n \t$menu entryconfigure 11 -state $mstate\n+\t$menu entryconfigure 12 -state $mstate\n     } else {\n \tset menu $fakerowmenu\n     }\n-- \n2.5.0.492.g918e48c\n"},{"id":"267971","messageId":"20150813073708.GA17652@fergus.ozlabs.ibm.com","threadId":"39883","inReplyTo":"1437218139-7031-1-git-send-email-dev+git@drbeat.li","subject":"Re: [PATCH v4] gitk: Add a \"Copy commit summary\" command","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2015-08-13T07:37:08Z","receivedAt":"2015-08-13T07:37:08Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Sat, Jul 18, 2015 at 01:15:39PM +0200, Beat Bolli wrote:\n> When referring to earlier commits in commit messages or other text, one\n> of the established formats is\n> \n>     <abbrev-sha> (\"<summary>\", <author-date>)\n> \n> Add a \"Copy commit summary\" command to the context menu that puts this\n> text for the currently selected commit on the clipboard. This makes it\n> easy for our users to create well-formatted commit references.\n> \n> The <abbrev-sha> is produced with the %h format specifier to make it\n> unique. Its length can be controlled with the gitk preference\n> \"Auto-select SHA1 (length)\", or, if this preference is set to its\n> default value (40), with the Git config setting core.abbrev.\n> \n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n\nThanks, applied.\n\nPaul.\n"},{"id":"268020","messageId":"55CCE9C9.5070209@drbeat.li","threadId":"39883","inReplyTo":"20150813073708.GA17652@fergus.ozlabs.ibm.com","subject":"Re: [PATCH v4] gitk: Add a \"Copy commit summary\" command","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2015-08-13T19:02:33Z","receivedAt":"2015-08-13T19:02:33Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"On 13.08.15 09:37, Paul Mackerras wrote:\n> On Sat, Jul 18, 2015 at 01:15:39PM +0200, Beat Bolli wrote:\n>> When referring to earlier commits in commit messages or other text, one\n>> of the established formats is\n>>\n>>     <abbrev-sha> (\"<summary>\", <author-date>)\n>>\n>> Add a \"Copy commit summary\" command to the context menu that puts this\n>> text for the currently selected commit on the clipboard. This makes it\n>> easy for our users to create well-formatted commit references.\n>>\n>> The <abbrev-sha> is produced with the %h format specifier to make it\n>> unique. Its length can be controlled with the gitk preference\n>> \"Auto-select SHA1 (length)\", or, if this preference is set to its\n>> default value (40), with the Git config setting core.abbrev.\n>>\n>> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> \n> Thanks, applied.\n> \nPlease also apply the follow-up patch in this thread [1]. It fixes menu\nentry numbers that were changed by this patch.\n\nThanks,\nBeat\n\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/275729\n"}]}