* [PATCH gitk 0/2] stop clobbering "Remember This View" setting
@ 2010-03-06 22:46 Jonathan Nieder
2010-03-06 22:48 ` [PATCH 1/2] gitk: Add comments to explain encode_view_opts and decode_view_opts Jonathan Nieder
2010-03-06 22:58 ` [PATCH 2/2] gitk: Stop clobbering "Remember This View" setting Jonathan Nieder
0 siblings, 2 replies; 3+ messages in thread
From: Jonathan Nieder @ 2010-03-06 22:46 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Steve Cotton, Alexander Gavrilov, git
Hi Paul,
As Steve Cotton reported [1], the Edit View... dialog in gitk
always defaults to not remembering the view, which makes it
easy to lose settings if one is not careful.
These patches fix it. The first one adds two one-line comments
from my investigation into the issue. The second one fixes the
obvious bug.
I am cc-ing others in case I have missed anything obvious or
people have comments on style.
I hope you enjoy the patches.
Kind regards,
Jonathan Nieder (2):
gitk: Add comments to explain encode_view_opts and decode_view_opts
gitk: Edit View unsets Remember this view
gitk | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
[1] http://bugs.debian.org/522520
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] gitk: Add comments to explain encode_view_opts and decode_view_opts
2010-03-06 22:46 [PATCH gitk 0/2] stop clobbering "Remember This View" setting Jonathan Nieder
@ 2010-03-06 22:48 ` Jonathan Nieder
2010-03-06 22:58 ` [PATCH 2/2] gitk: Stop clobbering "Remember This View" setting Jonathan Nieder
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Nieder @ 2010-03-06 22:48 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Steve Cotton, Alexander Gavrilov, git
Summarize these functions to save the reader some time.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
gitk | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/gitk b/gitk
index 1f36a3e..7f498b5 100755
--- a/gitk
+++ b/gitk
@@ -3845,6 +3845,7 @@ set known_view_options {
{cmd t50= + {} {mc "Command to generate more commits to include:"}}
}
+# Convert $newviewopts($n, ...) into args for git log.
proc encode_view_opts {n} {
global known_view_options newviewopts
@@ -3878,6 +3879,7 @@ proc encode_view_opts {n} {
return [concat $rargs [shellsplit $newviewopts($n,args)]]
}
+# Fill $newviewopts($n, ...) based on args for git log.
proc decode_view_opts {n view_args} {
global known_view_options newviewopts
--
1.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] gitk: Stop clobbering "Remember This View" setting
2010-03-06 22:46 [PATCH gitk 0/2] stop clobbering "Remember This View" setting Jonathan Nieder
2010-03-06 22:48 ` [PATCH 1/2] gitk: Add comments to explain encode_view_opts and decode_view_opts Jonathan Nieder
@ 2010-03-06 22:58 ` Jonathan Nieder
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Nieder @ 2010-03-06 22:58 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Steve Cotton, Alexander Gavrilov, git
In the View → Edit View... dialog, the "Remember this view" option
always starts out unset. Using the dialog to change an existing view
and ignoring the parts of the dialog that aren’t relevant results in
both the old and new versions of the view being lost.
The cause: right after newviewopts($curview,perm) is set to an
appropriate value, decode_view_opts is clobbering it with the default
value. If that call is moved a little earlier, the "Remember this
view" option gets properly set to its previous value, fixing the
problem.
Reported-by: Steve Cotton <steve0001@s.cotton.clara.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
gitk | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitk b/gitk
index 7f498b5..c3ef275 100755
--- a/gitk
+++ b/gitk
@@ -3805,10 +3805,10 @@ proc newview {ishighlight} {
raise $top
return
}
+ decode_view_opts $nextviewnum $revtreeargs
set newviewname($nextviewnum) "[mc "View"] $nextviewnum"
set newviewopts($nextviewnum,perm) 0
set newviewopts($nextviewnum,cmd) $viewargscmd($curview)
- decode_view_opts $nextviewnum $revtreeargs
vieweditor $top $nextviewnum [mc "Gitk view definition"]
}
@@ -3962,10 +3962,10 @@ proc editview {} {
raise $top
return
}
+ decode_view_opts $curview $viewargs($curview)
set newviewname($curview) $viewname($curview)
set newviewopts($curview,perm) $viewperm($curview)
set newviewopts($curview,cmd) $viewargscmd($curview)
- decode_view_opts $curview $viewargs($curview)
vieweditor $top $curview "[mc "Gitk: edit view"] $viewname($curview)"
}
--
1.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-06 22:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-06 22:46 [PATCH gitk 0/2] stop clobbering "Remember This View" setting Jonathan Nieder
2010-03-06 22:48 ` [PATCH 1/2] gitk: Add comments to explain encode_view_opts and decode_view_opts Jonathan Nieder
2010-03-06 22:58 ` [PATCH 2/2] gitk: Stop clobbering "Remember This View" setting Jonathan Nieder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).