{"thread":{"id":"2320","subject":"[PATCH] gitk: fix for empty line after Comments","startedAt":"2005-11-02T20:42:48Z","lastAt":"2005-11-02T20:42:48Z","messageCount":1,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"11029","messageId":"1130964168.23026.2.camel@dv","threadId":"2320","inReplyTo":null,"subject":"[PATCH] gitk: fix for empty line after Comments","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-11-02T20:42:48Z","receivedAt":"2005-11-02T20:42:48Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"git-diff-tree called with one tree-ish shows the commit ID, which should\nbe ignored by gitk.  getblobdiffs() and gettreediffline() recognize and\nignore commit ID now.\n\nAlso, the p variable that was used as the other argument git-diff-tree\nis no longer used, so it's dropped in both places.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\ndiff --git a/gitk b/gitk\nindex a9d37d9..e935484 100755\n--- a/gitk\n+++ b/gitk\n@@ -2805,7 +2805,6 @@ proc gettreediffs {ids} {\n     set treepending $ids\n     set treediff {}\n     set id [lindex $ids 0]\n-    set p [lindex $ids 1]\n     if [catch {set gdtf [open \"|git-diff-tree -r $id\" r]}] return\n     fconfigure $gdtf -blocking 0\n     fileevent $gdtf readable [list gettreediffline $gdtf $ids]\n@@ -2830,6 +2829,8 @@ proc gettreediffline {gdtf ids} {\n \t    }\n \t}\n \treturn\n+    } elseif {$n == 40} {\n+\treturn\n     }\n     set file [lindex $line 5]\n     lappend treediff $file\n@@ -2840,7 +2841,6 @@ proc getblobdiffs {ids} {\n     global difffilestart nextupdate diffinhdr treediffs\n \n     set id [lindex $ids 0]\n-    set p [lindex $ids 1]\n     set env(GIT_DIFF_OPTS) $diffopts\n     set cmd [list | git-diff-tree -r -p -C $id]\n     if {[catch {set bdf [open $cmd r]} err]} {\n@@ -2934,7 +2934,7 @@ proc getblobdiffline {bdf ids} {\n \t} elseif {$diffinhdr || $x == \"\\\\\"} {\n \t    # e.g. \"\\ No newline at end of file\"\n \t    $ctext insert end \"$line\\n\" filesep\n-\t} else {\n+\t} elseif {![regexp {^[0-9a-f]{40}$} $line]} {\n \t    # Something else we don't recognize\n \t    if {$curdifftag != \"Comments\"} {\n \t\t$ctext insert end \"\\n\"\n\n\n-- \nRegards,\nPavel Roskin\n"}]}