{"thread":{"id":"22933","subject":"[PATCH gitk 0/2] stop clobbering \"Remember This View\" setting","startedAt":"2010-03-06T22:46:05Z","lastAt":"2010-03-06T22:58:42Z","messageCount":3,"participants":["Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"136248","messageId":"20100306224605.GA7064@progeny.tock","threadId":"22933","inReplyTo":null,"subject":"[PATCH gitk 0/2] stop clobbering \"Remember This View\" setting","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-03-06T22:46:05Z","receivedAt":"2010-03-06T22:46:05Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Paul,\n\nAs Steve Cotton reported [1], the Edit View... dialog in gitk\nalways defaults to not remembering the view, which makes it\neasy to lose settings if one is not careful.\n\nThese patches fix it.  The first one adds two one-line comments\nfrom my investigation into the issue.  The second one fixes the\nobvious bug.\n\nI am cc-ing others in case I have missed anything obvious or\npeople have comments on style.\n\nI hope you enjoy the patches.\n\nKind regards,\nJonathan Nieder (2):\n  gitk: Add comments to explain encode_view_opts and decode_view_opts\n  gitk: Edit View unsets Remember this view\n\n gitk |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\n[1] http://bugs.debian.org/522520\n"},{"id":"136249","messageId":"20100306224837.GB7064@progeny.tock","threadId":"22933","inReplyTo":"20100306224605.GA7064@progeny.tock","subject":"[PATCH 1/2] gitk: Add comments to explain encode_view_opts and decode_view_opts","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-03-06T22:48:38Z","receivedAt":"2010-03-06T22:48:38Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Summarize these functions to save the reader some time.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n gitk |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 1f36a3e..7f498b5 100755\n--- a/gitk\n+++ b/gitk\n@@ -3845,6 +3845,7 @@ set known_view_options {\n     {cmd       t50= +  {}               {mc \"Command to generate more commits to include:\"}}\n     }\n \n+# Convert $newviewopts($n, ...) into args for git log.\n proc encode_view_opts {n} {\n     global known_view_options newviewopts\n \n@@ -3878,6 +3879,7 @@ proc encode_view_opts {n} {\n     return [concat $rargs [shellsplit $newviewopts($n,args)]]\n }\n \n+# Fill $newviewopts($n, ...) based on args for git log.\n proc decode_view_opts {n view_args} {\n     global known_view_options newviewopts\n \n-- \n1.7.0\n"},{"id":"136250","messageId":"20100306225842.GC7064@progeny.tock","threadId":"22933","inReplyTo":"20100306224605.GA7064@progeny.tock","subject":"[PATCH 2/2] gitk: Stop clobbering \"Remember This View\" setting","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-03-06T22:58:42Z","receivedAt":"2010-03-06T22:58:42Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"In the View → Edit View... dialog, the \"Remember this view\" option\nalways starts out unset.  Using the dialog to change an existing view\nand ignoring the parts of the dialog that aren’t relevant results in\nboth the old and new versions of the view being lost.\n\nThe cause: right after newviewopts($curview,perm) is set to an\nappropriate value, decode_view_opts is clobbering it with the default\nvalue.  If that call is moved a little earlier, the \"Remember this\nview\" option gets properly set to its previous value, fixing the\nproblem.\n\nReported-by: Steve Cotton <steve0001@s.cotton.clara.co.uk>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n gitk |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 7f498b5..c3ef275 100755\n--- a/gitk\n+++ b/gitk\n@@ -3805,10 +3805,10 @@ proc newview {ishighlight} {\n \traise $top\n \treturn\n     }\n+    decode_view_opts $nextviewnum $revtreeargs\n     set newviewname($nextviewnum) \"[mc \"View\"] $nextviewnum\"\n     set newviewopts($nextviewnum,perm) 0\n     set newviewopts($nextviewnum,cmd)  $viewargscmd($curview)\n-    decode_view_opts $nextviewnum $revtreeargs\n     vieweditor $top $nextviewnum [mc \"Gitk view definition\"]\n }\n \n@@ -3962,10 +3962,10 @@ proc editview {} {\n \traise $top\n \treturn\n     }\n+    decode_view_opts $curview $viewargs($curview)\n     set newviewname($curview)      $viewname($curview)\n     set newviewopts($curview,perm) $viewperm($curview)\n     set newviewopts($curview,cmd)  $viewargscmd($curview)\n-    decode_view_opts $curview $viewargs($curview)\n     vieweditor $top $curview \"[mc \"Gitk: edit view\"] $viewname($curview)\"\n }\n \n-- \n1.7.0\n"}]}