git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Repost: [PATCH] gitk: Decode the "-n" argument properly for Edit View

From
Jim Ramsay <i.am@jimramsay.com>
Date
Jun 2, 2010, 15:16 UTC
Message-ID
<20100602111657.2e91faec@vrm378-02.vrm378.am.mot.com>

Running 'gitk -n 42' and selecting View > Edit View... would previously put the '-n' half of the argument-pair in the box labeled "Additional arguments to git log" and the '42' in "Branches & Tags". Parse this pair properly and use the numerical portion for the 'limit' value.

Signed-off-by: Jim Ramsay <i.am@jimramsay.com>
---
 gitk-git/gitk |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 1b0e09a..f93e7e5 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -3907,6 +3907,17 @@ proc decode_view_opts {n view_args} {
     set oargs [list]
     set refargs [list]
     foreach arg $view_args {
+	# Decode 2-argument '-n 42' as 'limit'
+	if {[info exists haslimitarg]} {
+	    set newviewopts($n,limit) $arg
+	    set found(limit) 1
+	    unset haslimitarg
+	    continue
+	}
+	if {$arg eq "-n"} {
+	    set haslimitarg 1
+	    continue
+	}
 	if {[regexp -- {^-([0-9]+)$} $arg arg cnt]
 	    && ![info exists found(limit)]} {
 	    set newviewopts($n,limit) $cnt
-- 
1.7.0.2
Message 1 of 1 in “Repost: [PATCH] gitk: Decode the "-n" argument properly for Edit View”
  1. Jim RamsayJun 2, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.