git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Ramsay <i.am@jimramsay.com>
To: git@vger.kernel.org
Subject: [PATCH] gitk: Decode the "-n" argument properly for Edit View
Date: Tue,  4 May 2010 11:05:39 -0400	[thread overview]
Message-ID: <1272985539-24586-1-git-send-email-i.am@jimramsay.com> (raw)

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

             reply	other threads:[~2010-05-04 15:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-04 15:05 Jim Ramsay [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-06-10 16:33 [PATCH] gitk: Decode the "-n" argument properly for Edit View Jim Ramsay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1272985539-24586-1-git-send-email-i.am@jimramsay.com \
    --to=i.am@jimramsay.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).