public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ray Lehtiniemi <rayl@mail•com>
To: Junio C Hamano <junkio@cox•net>
Cc: git@vger•kernel.org
Subject: Enhanced diff options for gitk (Re: --unified=0)
Date: Sat, 03 Feb 2007 15:12:51 -0700	[thread overview]
Message-ID: <200702031512.52778.rayl@mail.com> (raw)
In-Reply-To: <7virej3rkt.fsf@assigned-by-dhcp.cox.net>

On Saturday 03 February 2007 13:37, Junio C Hamano wrote:

> That's sick.

:-)  i actually only noticed it while testing this patch....

 
-- >8 --
[PATCH] Enhanced diff options for gitk.

The diff options box in the gitk preferences dialog
doesn't do much because the GIT_DIFF_OPTS environment
variable only honors the --unified option.

Adjust the usage of $diffopts and remove GIT_DIFF_OPTS
from gitk so that other diff options will be honored.

Signed-off-by: Ray Lehtiniemi <rayl@mail•com>
---
 gitk |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/gitk b/gitk
index 68cfd63..7ee19b7 100755
--- a/gitk
+++ b/gitk
@@ -4183,9 +4183,7 @@ proc mergediff {id l} {
 
     set diffmergeid $id
     set diffids $id
-    # this doesn't seem to actually affect anything...
-    set env(GIT_DIFF_OPTS) $diffopts
-    set cmd [concat | git diff-tree --no-commit-id --cc $id]
+    set cmd [concat | git diff-tree $diffopts --no-commit-id --cc $id]
     if {[catch {set mdf [open $cmd r]} err]} {
 	error_popup "Error getting merge diffs: $err"
 	return
@@ -4332,8 +4330,7 @@ proc getblobdiffs {ids} {
     global diffopts blobdifffd diffids env curdifftag curtagstart
     global nextupdate diffinhdr treediffs
 
-    set env(GIT_DIFF_OPTS) $diffopts
-    set cmd [concat | git diff-tree --no-commit-id -r -p -C $ids]
+    set cmd [concat | git diff-tree $diffopts --no-commit-id -r -p -C $ids]
     if {[catch {set bdf [open $cmd r]} err]} {
 	puts "error getting diffs: $err"
 	return
@@ -5896,7 +5893,7 @@ proc prefscan {} {
 }
 
 proc prefsok {} {
-    global maxwidth maxgraphpct
+    global maxwidth maxgraphpct diffopts
     global oldprefs prefstop showneartags
 
     catch {destroy $prefstop}
@@ -5906,6 +5903,8 @@ proc prefsok {} {
 	redisplay
     } elseif {$showneartags != $oldprefs(showneartags)} {
 	reselectline
+    } elseif {$diffopts != $oldprefs(diffopts)} {
+	reselectline
     }
 }
 
@@ -6188,7 +6187,7 @@ proc tcl_encoding {enc} {
 
 # defaults...
 set datemode 0
-set diffopts "-U 5 -p"
+set diffopts ""
 set wrcomcmd "git diff-tree --stdin -p --pretty"
 
 set gitencoding {}
-- 
1.5.0.rc3.28.g8bbd

      reply	other threads:[~2007-02-03 22:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-02 16:19 a slight anomaly in '--unified=0' diff output for one particular commit? Ray Lehtiniemi
2007-02-03 20:37 ` Junio C Hamano
2007-02-03 22:12   ` Ray Lehtiniemi [this message]

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=200702031512.52778.rayl@mail.com \
    --to=rayl@mail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=junkio@cox$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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