{"thread":{"id":"35988","subject":"[PATCH] gitk: replace SHA1 entry field on keyboard paste","startedAt":"2014-02-28T06:51:37Z","lastAt":"2014-06-15T04:55:37Z","messageCount":4,"participants":["Ilya Bobyr","Junio C Hamano","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"235545","messageId":"1393570297-6012-1-git-send-email-ilya.bobyr@gmail.com","threadId":"35988","inReplyTo":null,"subject":"[PATCH] gitk: replace SHA1 entry field on keyboard paste","fromName":"Ilya Bobyr","fromEmail":"ilya.bobyr@gmail.com","sentAt":"2014-02-28T06:51:37Z","receivedAt":"2014-02-28T06:51:37Z","isPatch":true,"sender":{"key":"ilya.bobyr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/694419?v=4"},"body":"We already replace old SHA with the clipboard content for the mouse\npaste event.  It seems reasonable to do the same when pasting from\nkeyboard.\n\nSigned-off-by: Ilya Bobyr <ilya.bobyr@gmail.com>\n---\n gitk-git/gitk |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 90764e8..2f58bcf 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -2585,6 +2585,7 @@ proc makewindow {} {\n     bind $fstring <Key-Return> {dofind 1 1}\n     bind $sha1entry <Key-Return> {gotocommit; break}\n     bind $sha1entry <<PasteSelection>> clearsha1\n+    bind $sha1entry <<Paste>> clearsha1\n     bind $cflist <1> {sel_flist %W %x %y; break}\n     bind $cflist <B1-Motion> {sel_flist %W %x %y; break}\n     bind $cflist <ButtonRelease-1> {treeclick %W %x %y}\n-- \n1.7.9\n"},{"id":"236015","messageId":"xmqqmwh5ltjo.fsf@gitster.dls.corp.google.com","threadId":"35988","inReplyTo":"1393570297-6012-1-git-send-email-ilya.bobyr@gmail.com","subject":"[PATCH] gitk: replace SHA1 entry field on keyboard paste","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-04T18:15:07Z","receivedAt":"2014-03-04T18:15:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"From: Ilya Bobyr <ilya.bobyr@gmail.com>\nDate: Thu, 27 Feb 2014 22:51:37 -0800\n\nWe already replace old SHA with the clipboard content for the mouse\npaste event.  It seems reasonable to do the same when pasting from\nkeyboard.\n\nSigned-off-by: Ilya Bobyr <ilya.bobyr@gmail.com>\n---\n\n * Paul?  I do not use <<Paste>> on my keyboard, so I am not in the\n   position to say that this patch is correct (or not).  I am just\n   forwarding it in case you think gitk users will find it useful.\n\n   The original patch was done against my tree, so I hand tweaked it\n   to apply to your tree.\n   \n   Thanks.\n\n gitk |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 90764e8..2f58bcf 100755\n--- a/gitk\n+++ b/gitk\n@@ -2585,6 +2585,7 @@ proc makewindow {} {\n     bind $fstring <Key-Return> {dofind 1 1}\n     bind $sha1entry <Key-Return> {gotocommit; break}\n     bind $sha1entry <<PasteSelection>> clearsha1\n+    bind $sha1entry <<Paste>> clearsha1\n     bind $cflist <1> {sel_flist %W %x %y; break}\n     bind $cflist <B1-Motion> {sel_flist %W %x %y; break}\n     bind $cflist <ButtonRelease-1> {treeclick %W %x %y}\n"},{"id":"236076","messageId":"5316E4F6.2080803@gmail.com","threadId":"35988","inReplyTo":"xmqqmwh5ltjo.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] gitk: replace SHA1 entry field on keyboard paste","fromName":"Ilya Bobyr","fromEmail":"illia.bobyr@gmail.com","sentAt":"2014-03-05T08:48:54Z","receivedAt":"2014-03-05T08:48:54Z","isPatch":true,"sender":{"key":"illia.bobyr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/694419?v=4"},"body":"On 3/4/2014 10:15 AM, Junio C Hamano wrote:\n> From: Ilya Bobyr <ilya.bobyr@gmail.com>\n> Date: Thu, 27 Feb 2014 22:51:37 -0800\n>\n> We already replace old SHA with the clipboard content for the mouse\n> paste event.  It seems reasonable to do the same when pasting from\n> keyboard.\n>\n> Signed-off-by: Ilya Bobyr <ilya.bobyr@gmail.com>\n> ---\n>\n>   * Paul?  I do not use <<Paste>> on my keyboard, so I am not in the\n>     position to say that this patch is correct (or not).  I am just\n>     forwarding it in case you think gitk users will find it useful.\n\nI should have included a cover letter with additional details on what is \nthis.\nI am still a bit new to the process, so I did not realize it would be \nuseful until now.\n\n<<Paste>> is the \"clipboard paste\" shortcut.  Ctrl+V on WIndows and Ubuntu.\n\nSHA fields in gitk is a text field that accepts focus.  My expectation \nis that I can replace SHA already in there with one I have in the clipboard.\nThe problem is that I was not able to find an easy way.  Not immediately \nat least.\nHere is what I observed:\n1. If I just click in there and press Ctrl+V, SHA from the clipboard is \ninserted in the spot that I clicked.  Most cases in the middle of the \nSHA symbols already in there.\n      Fixing the mess afterwards in just impossible.\n2. If I double click \"old\" SHA in order to select and delete it before \nthe paste, selected text is automatically copied into the clipboard (at \nleast on Cygwin).\n     While the SHA field is now empty to accept \"new\" SHA, the clipboard \ncontent is lost and I have to go copy new SHA into the clipboard again.\n3. I can click once to give SHA field keyboard focus, delete whatever is \nthere using Delete and/or Backspace and then paste new SHA.\n     While this works it is not very convenient.  I also keeped pressing \nCtrl+W to \"delete a word\" that was closing gitk window completely %)\n\nNow, it turned out that if I use mouse to do the paste, not the \nkeyboard, it does do what actually makes sense: removes old SHA and \npastes the new one.\nAs SHA's are atomic, there seems to be no value in been able to insert \none in the middle of another.\n\nThe bug, as I see it, is that it happens only if mouse paste is used.  \nThat would be the \"<<PasteSelection>>\" in the line above the added one.\n\nWhen keyboard paste is used old SHA is not cleared.\n\nI guess one would say that inserting with the mouse is actually easier, \nbut been a Windows user it was unusual to me to use mouse paste in the GUI.\nI have never even thought to do that and was struggling for quite a while.\n\nThe patch makes both mouse and keyboard paste work the same.\nI think that could help someone else who is not used to mouse paste in \nthe GUI text boxes as well.\n\n>     The original patch was done against my tree, so I hand tweaked it\n>     to apply to your tree.\n>     \n>     Thanks.\n>\n>   gitk |    1 +\n>   1 files changed, 1 insertions(+), 0 deletions(-)\n>\n> diff --git a/gitk b/gitk\n> index 90764e8..2f58bcf 100755\n> --- a/gitk\n> +++ b/gitk\n> @@ -2585,6 +2585,7 @@ proc makewindow {} {\n>       bind $fstring <Key-Return> {dofind 1 1}\n>       bind $sha1entry <Key-Return> {gotocommit; break}\n>       bind $sha1entry <<PasteSelection>> clearsha1\n> +    bind $sha1entry <<Paste>> clearsha1\n>       bind $cflist <1> {sel_flist %W %x %y; break}\n>       bind $cflist <B1-Motion> {sel_flist %W %x %y; break}\n>       bind $cflist <ButtonRelease-1> {treeclick %W %x %y}\n"},{"id":"244199","messageId":"20140615045537.GA21978@iris.ozlabs.ibm.com","threadId":"35988","inReplyTo":"1395305931-5248-1-git-send-email-ilya.bobyr@gmail.com","subject":"Re: [PATCH] gitk: replace SHA1 entry field on keyboard paste","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2014-06-15T04:55:37Z","receivedAt":"2014-06-15T04:55:37Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Thu, Mar 20, 2014 at 01:58:51AM -0700, Ilya Bobyr wrote:\n> We already replace old SHA with the clipboard content for the mouse\n> paste event.  It seems reasonable to do the same when pasting from\n> keyboard.\n> \n> Signed-off-by: Ilya Bobyr <ilya.bobyr@gmail.com>\n\nThanks, applied.\n\nPaul.\n"}]}