{"thread":{"id":"23694","subject":"[PATCH] gitk: Decode the \"-n\" argument properly for Edit View","startedAt":"2010-05-04T15:05:39Z","lastAt":"2010-05-04T15:05:39Z","messageCount":1,"participants":["Jim Ramsay"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"140907","messageId":"1272985539-24586-1-git-send-email-i.am@jimramsay.com","threadId":"23694","inReplyTo":null,"subject":"[PATCH] gitk: Decode the \"-n\" argument properly for Edit View","fromName":"Jim Ramsay","fromEmail":"i.am@jimramsay.com","sentAt":"2010-05-04T15:05:39Z","receivedAt":"2010-05-04T15:05:39Z","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 put the\n'-n' half of the argument-pair in the box labeled \"Additional arguments to git\nlog\" and the '42' in \"Branches & Tags\".  Parse this pair properly and use the\nnumerical 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"}]}