Git development
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [RFD] Strange patch formats (aka tricks with unified diffs)..
Date: Wed, 18 Apr 2007 11:44:18 +1000	[thread overview]
Message-ID: <17957.30706.398078.689096@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0704130812390.28042@woody.linux-foundation.org>

Linus Torvalds writes:

> Ok, just a radio button for the patch case for "show patch" vs "show 
> result" would certainly be sufficient for what I normally do. Adding the 
> case "show origin" for completeness (ie filter out the new lines, rather 
> than filtering out the old lines) is probably a good idea, even if I've 
> never used it.

Try this patch, let me know what you think...

Paul.

diff --git a/gitk b/gitk
index b1c65d7..a57e84c 100755
--- a/gitk
+++ b/gitk
@@ -593,6 +593,7 @@ proc makewindow {} {
         frame .bleft -width $geometry(botwidth) -height $geometry(botheight)
     }
     frame .bleft.top
+    frame .bleft.mid
 
     button .bleft.top.search -text "Search" -command dosearch \
 	-font $uifont
@@ -602,12 +603,20 @@ proc makewindow {} {
     lappend entries $sstring
     trace add variable searchstring write incrsearch
     pack $sstring -side left -expand 1 -fill x
+    radiobutton .bleft.mid.diff -text "Diff" \
+	-command changediffdisp -variable diffelide -value {0 0}
+    radiobutton .bleft.mid.old -text "Old version" \
+	-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
     set ctext .bleft.ctext
     text $ctext -background $bgcolor -foreground $fgcolor \
 	-state disabled -font $textfont \
 	-yscrollcommand scrolltext -wrap none
     scrollbar .bleft.sb -command "$ctext yview"
     pack .bleft.top -side top -fill x
+    pack .bleft.mid -side top -fill x
     pack .bleft.sb -side right -fill y
     pack $ctext -side left -fill both -expand 1
     lappend bglist $ctext
@@ -4486,6 +4495,13 @@ proc getblobdiffline {bdf ids} {
     }
 }
 
+proc changediffdisp {} {
+    global ctext diffelide
+
+    $ctext tag conf d0 -elide [lindex $diffelide 0]
+    $ctext tag conf d1 -elide [lindex $diffelide 1]
+}
+
 proc prevfile {} {
     global difffilestart ctext
     set prev [lindex $difffilestart 0]
@@ -6330,6 +6346,7 @@ set highlight_paths {}
 set searchdirn -forwards
 set boldrows {}
 set boldnamerows {}
+set diffelide {0 0}
 
 set optim_delay 16
 

  reply	other threads:[~2007-04-18  1:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-12 21:58 [RFD] Strange patch formats (aka tricks with unified diffs) Linus Torvalds
2007-04-12 23:02 ` Junio C Hamano
2007-04-13  5:38 ` Marco Costalba
2007-04-17 18:02   ` Marco Costalba
2007-04-13  5:43 ` Paul Mackerras
2007-04-13  6:07   ` Martin Langhoff
2007-04-13  6:35     ` Junio C Hamano
2007-04-13  7:01       ` Martin Langhoff
2007-04-14  8:59       ` Johannes Schindelin
2007-04-14  9:55         ` Junio C Hamano
2007-04-14 10:09           ` Jeff King
2007-04-13 15:16   ` Linus Torvalds
2007-04-18  1:44     ` Paul Mackerras [this message]
2007-04-18  4:02       ` Linus Torvalds
2007-04-13  8:10 ` Matthias Lederhofer
2007-04-13 15:00   ` Linus Torvalds

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=17957.30706.398078.689096@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.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