git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitk: fix for empty line after Comments
@ 2005-11-02 20:42 Pavel Roskin
  0 siblings, 0 replies; only message in thread
From: Pavel Roskin @ 2005-11-02 20:42 UTC (permalink / raw)
  To: git

git-diff-tree called with one tree-ish shows the commit ID, which should
be ignored by gitk.  getblobdiffs() and gettreediffline() recognize and
ignore commit ID now.

Also, the p variable that was used as the other argument git-diff-tree
is no longer used, so it's dropped in both places.

Signed-off-by: Pavel Roskin <proski@gnu.org>

diff --git a/gitk b/gitk
index a9d37d9..e935484 100755
--- a/gitk
+++ b/gitk
@@ -2805,7 +2805,6 @@ proc gettreediffs {ids} {
     set treepending $ids
     set treediff {}
     set id [lindex $ids 0]
-    set p [lindex $ids 1]
     if [catch {set gdtf [open "|git-diff-tree -r $id" r]}] return
     fconfigure $gdtf -blocking 0
     fileevent $gdtf readable [list gettreediffline $gdtf $ids]
@@ -2830,6 +2829,8 @@ proc gettreediffline {gdtf ids} {
 	    }
 	}
 	return
+    } elseif {$n == 40} {
+	return
     }
     set file [lindex $line 5]
     lappend treediff $file
@@ -2840,7 +2841,6 @@ proc getblobdiffs {ids} {
     global difffilestart nextupdate diffinhdr treediffs
 
     set id [lindex $ids 0]
-    set p [lindex $ids 1]
     set env(GIT_DIFF_OPTS) $diffopts
     set cmd [list | git-diff-tree -r -p -C $id]
     if {[catch {set bdf [open $cmd r]} err]} {
@@ -2934,7 +2934,7 @@ proc getblobdiffline {bdf ids} {
 	} elseif {$diffinhdr || $x == "\\"} {
 	    # e.g. "\ No newline at end of file"
 	    $ctext insert end "$line\n" filesep
-	} else {
+	} elseif {![regexp {^[0-9a-f]{40}$} $line]} {
 	    # Something else we don't recognize
 	    if {$curdifftag != "Comments"} {
 		$ctext insert end "\n"


-- 
Regards,
Pavel Roskin

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-02 20:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-02 20:42 [PATCH] gitk: fix for empty line after Comments Pavel Roskin

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