{"thread":{"id":"39851","subject":"[PATCH] gitk: Add a \"Copy commit summary\" command","startedAt":"2015-07-14T16:42:30Z","lastAt":"2015-07-16T00:59:46Z","messageCount":5,"participants":["dev+git@drbeat.li","Stefan Beller","Keller, Jacob E","Eric Sunshine","Jacob Keller"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"266133","messageId":"1436892150-24267-1-git-send-email-dev+git@drbeat.li","threadId":"39851","inReplyTo":null,"subject":"[PATCH] gitk: Add a \"Copy commit summary\" command","fromName":"","fromEmail":"dev+git@drbeat.li","sentAt":"2015-07-14T16:42:30Z","receivedAt":"2015-07-14T16:42:30Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"From: Beat Bolli <dev+git@drbeat.li>\n\nWhen referencing earlier commits in new commit messages or other text,\none of the established formats is\n\n    commit <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\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\nCc: Paul Mackerras <paulus@samba.org>\n---\n gitk-git/gitk | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 9a2daf3..0612331 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,19 @@ proc mktaggo {} {\n     mktagcan\n }\n \n+proc copysummary {} {\n+    global rowmenuid commitinfo\n+\n+    set id [string range $rowmenuid 0 7]\n+    set info $commitinfo($rowmenuid)\n+    set commit [lindex $info 0]\n+    set date [formatdate [lindex $info 2]]\n+    set summary \"[mc \"commit\"] $id (\\\"$commit\\\", $date)\"\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":"266140","messageId":"CAGZ79kaB-vrarcCztD_7x5M1_dHWwMy=6vQ5EHHsWTJTWEyhOA@mail.gmail.com","threadId":"39851","inReplyTo":"1436892150-24267-1-git-send-email-dev+git@drbeat.li","subject":"Re: [PATCH] gitk: Add a \"Copy commit summary\" command","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-07-14T20:34:16Z","receivedAt":"2015-07-14T20:34:16Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Tue, Jul 14, 2015 at 9:42 AM,  <dev+git@drbeat.li> wrote:\n> From: Beat Bolli <dev+git@drbeat.li>\n>\n> When referencing earlier commits in new commit messages or other text,\n> one of the established formats is\n>\n>     commit <abbrev-sha> (\"<summary>\", <author-date>)\n\nThat sounds like I would use it a lot! Thanks :)\n\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> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> Cc: Paul Mackerras <paulus@samba.org>\n> ---\n>  gitk-git/gitk | 14 ++++++++++++++\n>  1 file changed, 14 insertions(+)\n>\n> diff --git a/gitk-git/gitk b/gitk-git/gitk\n> index 9a2daf3..0612331 100755\n> --- a/gitk-git/gitk\n> +++ b/gitk-git/gitk\n> @@ -2617,6 +2617,7 @@ proc makewindow {} {\n>         {mc \"Diff selected -> this\" command {diffvssel 1}}\n>         {mc \"Make patch\" command mkpatch}\n>         {mc \"Create tag\" command mktag}\n> +       {mc \"Copy commit summary\" command copysummary}\n>         {mc \"Write commit to file\" command writecommit}\n>         {mc \"Create new branch\" command mkbranch}\n>         {mc \"Cherry-pick this commit\" command cherrypick}\n> @@ -9341,6 +9342,19 @@ proc mktaggo {} {\n>      mktagcan\n>  }\n>\n> +proc copysummary {} {\n> +    global rowmenuid commitinfo\n> +\n> +    set id [string range $rowmenuid 0 7]\n> +    set info $commitinfo($rowmenuid)\n> +    set commit [lindex $info 0]\n> +    set date [formatdate [lindex $info 2]]\n> +    set summary \"[mc \"commit\"] $id (\\\"$commit\\\", $date)\"\n> +\n> +    clipboard clear\n> +    clipboard append $summary\n> +}\n> +\n>  proc writecommit {} {\n>      global rowmenuid wrcomtop commitinfo wrcomcmd NS\n>\n> --\n> 2.1.4\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"266166","messageId":"1436999097.12921.2.camel@intel.com","threadId":"39851","inReplyTo":"CAGZ79kaB-vrarcCztD_7x5M1_dHWwMy=6vQ5EHHsWTJTWEyhOA@mail.gmail.com","subject":"Re: [PATCH] gitk: Add a \"Copy commit summary\" command","fromName":"Keller, Jacob E","fromEmail":"jacob.e.keller@intel.com","sentAt":"2015-07-15T22:24:57Z","receivedAt":"2015-07-15T22:24:57Z","isPatch":true,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Tue, 2015-07-14 at 13:34 -0700, Stefan Beller wrote:\n> On Tue, Jul 14, 2015 at 9:42 AM,  <dev+git@drbeat.li> wrote:\n> > From: Beat Bolli <dev+git@drbeat.li>\n> > \n> > When referencing earlier commits in new commit messages or other \n> > text,\n> > one of the established formats is\n> > \n> >     commit <abbrev-sha> (\"<summary>\", <author-date>)\n> \n> That sounds like I would use it a lot! Thanks :)\n> \n\nYep, quite useful. Also, the kernel suggests using it as a tag like so\n\nFixes: <abbrev-sha> (\"summary\")\n\nI really like this :)\n\nRegards,\nJake\n\n> > \n> > Add a \"Copy commit summary\" command to the context menu that puts \n> > this\n> > text for the currently selected commit on the clipboard. This makes \n> > it\n> > easy for our users to create well-formatted commit references.\n> > \n> > Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> > Cc: Paul Mackerras <paulus@samba.org>\n> > ---\n> >  gitk-git/gitk | 14 ++++++++++++++\n> >  1 file changed, 14 insertions(+)\n> > \n> > diff --git a/gitk-git/gitk b/gitk-git/gitk\n> > index 9a2daf3..0612331 100755\n> > --- a/gitk-git/gitk\n> > +++ b/gitk-git/gitk\n> > @@ -2617,6 +2617,7 @@ proc makewindow {} {\n> >         {mc \"Diff selected -> this\" command {diffvssel 1}}\n> >         {mc \"Make patch\" command mkpatch}\n> >         {mc \"Create tag\" command mktag}\n> > +       {mc \"Copy commit summary\" command copysummary}\n> >         {mc \"Write commit to file\" command writecommit}\n> >         {mc \"Create new branch\" command mkbranch}\n> >         {mc \"Cherry-pick this commit\" command cherrypick}\n> > @@ -9341,6 +9342,19 @@ proc mktaggo {} {\n> >      mktagcan\n> >  }\n> > \n> > +proc copysummary {} {\n> > +    global rowmenuid commitinfo\n> > +\n> > +    set id [string range $rowmenuid 0 7]\n> > +    set info $commitinfo($rowmenuid)\n> > +    set commit [lindex $info 0]\n> > +    set date [formatdate [lindex $info 2]]\n> > +    set summary \"[mc \"commit\"] $id (\\\"$commit\\\", $date)\"\n> > +\n> > +    clipboard clear\n> > +    clipboard append $summary\n> > +}\n> > +\n> >  proc writecommit {} {\n> >      global rowmenuid wrcomtop commitinfo wrcomcmd NS\n> > \n> > --\n> > 2.1.4\n> > --\n> > To unsubscribe from this list: send the line \"unsubscribe git\" in\n> > the body of a message to majordomo@vger.kernel.org\n> > More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html"},{"id":"266168","messageId":"CAPig+cTf3WDHf++Ck-SXgY4LRm7WRLLk2BvewUQZktfdpHL4BA@mail.gmail.com","threadId":"39851","inReplyTo":"1436999097.12921.2.camel@intel.com","subject":"Re: [PATCH] gitk: Add a \"Copy commit summary\" command","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-07-15T23:58:01Z","receivedAt":"2015-07-15T23:58:01Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Jul 15, 2015 at 6:24 PM, Keller, Jacob E\n<jacob.e.keller@intel.com> wrote:\n> On Tue, 2015-07-14 at 13:34 -0700, Stefan Beller wrote:\n>> On Tue, Jul 14, 2015 at 9:42 AM,  <dev+git@drbeat.li> wrote:\n>> > From: Beat Bolli <dev+git@drbeat.li>\n>> >\n>> > When referencing earlier commits in new commit messages or other\n>> > text,\n>> > one of the established formats is\n>> >\n>> >     commit <abbrev-sha> (\"<summary>\", <author-date>)\n>>\n>> That sounds like I would use it a lot! Thanks :)\n>>\n>\n> Yep, quite useful. Also, the kernel suggests using it as a tag like so\n>\n> Fixes: <abbrev-sha> (\"summary\")\n\nDropping the literal word \"commit\" would make this use-case more\nconvenient, as well as the typical use-case when composing commit\nmessages: \"Since <abrrev-sha1> (\"blah\", <date>), foobar.c has\nflabble-nabbered the wonka-doodle...\"\n"},{"id":"266169","messageId":"CA+P7+xrKc_t6_ntc0jFoHJgYrira74+swqy5kFuuFn_gC9Ft2Q@mail.gmail.com","threadId":"39851","inReplyTo":"CAPig+cTf3WDHf++Ck-SXgY4LRm7WRLLk2BvewUQZktfdpHL4BA@mail.gmail.com","subject":"Re: [PATCH] gitk: Add a \"Copy commit summary\" command","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2015-07-16T00:59:46Z","receivedAt":"2015-07-16T00:59:46Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"Agreed. I haven't seen \"commit\" used much in the past, and you can\neasily type that out as it is.\n\nOn Wed, Jul 15, 2015 at 4:58 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n> On Wed, Jul 15, 2015 at 6:24 PM, Keller, Jacob E\n> <jacob.e.keller@intel.com> wrote:\n>> On Tue, 2015-07-14 at 13:34 -0700, Stefan Beller wrote:\n>>> On Tue, Jul 14, 2015 at 9:42 AM,  <dev+git@drbeat.li> wrote:\n>>> > From: Beat Bolli <dev+git@drbeat.li>\n>>> >\n>>> > When referencing earlier commits in new commit messages or other\n>>> > text,\n>>> > one of the established formats is\n>>> >\n>>> >     commit <abbrev-sha> (\"<summary>\", <author-date>)\n>>>\n>>> That sounds like I would use it a lot! Thanks :)\n>>>\n>>\n>> Yep, quite useful. Also, the kernel suggests using it as a tag like so\n>>\n>> Fixes: <abbrev-sha> (\"summary\")\n>\n> Dropping the literal word \"commit\" would make this use-case more\n> convenient, as well as the typical use-case when composing commit\n> messages: \"Since <abrrev-sha1> (\"blah\", <date>), foobar.c has\n> flabble-nabbered the wonka-doodle...\"\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"}]}