git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitk: Handle blobs containing a DOS end-of-file marker.
@ 2009-03-16 10:24 Pat Thoyts
  2009-03-23 10:33 ` Paul Mackerras
  0 siblings, 1 reply; 2+ messages in thread
From: Pat Thoyts @ 2009-03-16 10:24 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras


  If a patchset contains an EOF marker (Ctrl-Z) the blob diff terminates
  at that point. This patch permits gitk to ignore the eof and continue to
  display any subsequent blobs and also displays a sensible representation
  of the eof char.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 gitk |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gitk b/gitk
index 1773ae6..d7de27e 100755
--- a/gitk
+++ b/gitk
@@ -7216,7 +7216,7 @@ proc getblobdiffs {ids} {
     set diffnparents 0
     set diffinhdr 0
     set diffencoding [get_path_encoding {}]
-    fconfigure $bdf -blocking 0 -encoding binary
+    fconfigure $bdf -blocking 0 -encoding binary -eofchar {}
     set blobdifffd($ids) $bdf
     filerun $bdf [list getblobdiffline $bdf $diffids]
 }
@@ -7367,7 +7367,8 @@ proc getblobdiffline {bdf ids} {
 	    $ctext insert end "$line\n" filesep
 
 	} else {
-	    set line [encoding convertfrom $diffencoding $line]
+	    set line [string map {\x1A ^Z} \
+                          [encoding convertfrom $diffencoding $line]]
 	    # parse the prefix - one ' ', '-' or '+' for each parent
 	    set prefix [string range $line 0 [expr {$diffnparents - 1}]]
 	    set tag [expr {$diffnparents > 1? "m": "d"}]
-- 
1.6.2.1217.gd7bc3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-23 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-16 10:24 [PATCH] gitk: Handle blobs containing a DOS end-of-file marker Pat Thoyts
2009-03-23 10:33 ` Paul Mackerras

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).