git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Steffen Prohaska <prohaska@zib.de>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH v4, ping] gitk: let you easily specify lines of context in diff view
Date: Sun, 12 Aug 2007 13:17:45 +1000	[thread overview]
Message-ID: <18110.31705.747583.463206@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <11868462503722-git-send-email-prohaska@zib.de>

Steffen Prohaska writes:

> Any chance to get this patch applied? It works for me.

Some comments:

> @@ -731,7 +732,16 @@ proc makewindow {} {
>  	-command changediffdisp -variable diffelide -value {0 1}
>      radiobutton .bleft.mid.new -text "New version" \
>  	-command changediffdisp -variable diffelide -value {1 0}
> -    pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left

Just add another pack command rather than extending this one.

> +    label .bleft.mid.labeldiffcontext -text "      Lines of context: " \
> +    -font $uifont

This is hard to read because the continuation line isn't indented
further that the first line.  Please indent continuation lines by an
extra 4 spaces.

> +# empty strings or integers accepted
> +proc diffcontextvalidate {v} {
> +    if {[string length $v] == 0} {
> +	return 1
> +    }
> +    if {[string is integer $v]} {
> +	if {$v > 0} {
> +	    return 1
> +	}
> +    }
> +    return 0
> +}

"string is integer" will already accept the null string and return 1.

> +proc diffcontextchange {n1 n2 op} {
> +    global diffcontextstring diffcontext
> +
> +    if {[string is integer $diffcontextstring]} {
> +        if {$diffcontextstring > 0} {

Once again, "string is integer" returning 1 doesn't guarantee the
string is non-empty.  Use "string is integer -strict" if you want
that.

> +            set diffcontext $diffcontextstring
> +		    reselectline

Inconsistent indentation.

> +set diffcontext 3
> +

It would be nice to save diffcontext in the ~/.gitkrc.

Paul.

  reply	other threads:[~2007-08-12  5:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-26  7:59 [PATCH] gitk: let you easily specify lines of context in diff view Steffen Prohaska
2007-07-26 12:34 ` Paul Mackerras
2007-07-27  5:52   ` Steffen Prohaska
2007-07-27 10:31     ` Paul Mackerras
2007-07-27 11:44       ` [PATCH v2] " Steffen Prohaska
2007-07-28 19:18         ` [PATCH v3] " Steffen Prohaska
2007-08-11 15:30           ` [PATCH v4, ping] " Steffen Prohaska
2007-08-12  3:17             ` Paul Mackerras [this message]
2007-08-12 10:02               ` Steffen Prohaska
2007-08-12 10:05                 ` [PATCH v5] " Steffen Prohaska

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=18110.31705.747583.463206@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=prohaska@zib.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).