{"thread":{"id":"23983","subject":"Repost: [PATCH] gitk: Decode the \"-n\" argument properly for Edit View","startedAt":"2010-06-02T15:16:57Z","lastAt":"2010-06-02T15:16:57Z","messageCount":1,"participants":["Jim Ramsay"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"142828","messageId":"20100602111657.2e91faec@vrm378-02.vrm378.am.mot.com","threadId":"23983","inReplyTo":null,"subject":"Repost: [PATCH] gitk: Decode the \"-n\" argument properly for Edit View","fromName":"Jim Ramsay","fromEmail":"i.am@jimramsay.com","sentAt":"2010-06-02T15:16:57Z","receivedAt":"2010-06-02T15:16:57Z","isPatch":true,"sender":{"key":"i.am@jimramsay.com","avatar":"https://gravatar.com/avatar/c5ae780989e8617fa3ad9c389bbbd3c57fa622ea3c27747ecf67a8891b15a35f?d=mp&s=160"},"body":"Running 'gitk -n 42' and selecting View > Edit View... would previously\nput the '-n' half of the argument-pair in the box labeled \"Additional\narguments to git log\" and the '42' in \"Branches & Tags\".  Parse this\npair properly and use the numerical portion for the 'limit' value.\n\nSigned-off-by: Jim Ramsay <i.am@jimramsay.com>\n---\n gitk-git/gitk |   11 +++++++++++\n 1 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 1b0e09a..f93e7e5 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -3907,6 +3907,17 @@ proc decode_view_opts {n view_args} {\n     set oargs [list]\n     set refargs [list]\n     foreach arg $view_args {\n+\t# Decode 2-argument '-n 42' as 'limit'\n+\tif {[info exists haslimitarg]} {\n+\t    set newviewopts($n,limit) $arg\n+\t    set found(limit) 1\n+\t    unset haslimitarg\n+\t    continue\n+\t}\n+\tif {$arg eq \"-n\"} {\n+\t    set haslimitarg 1\n+\t    continue\n+\t}\n \tif {[regexp -- {^-([0-9]+)$} $arg arg cnt]\n \t    && ![info exists found(limit)]} {\n \t    set newviewopts($n,limit) $cnt\n-- \n1.7.0.2\n"}]}