Skip to content

Commit

Permalink
gitk: Do not pick up file names of "copy from" lines
Browse files Browse the repository at this point in the history
A file copy would be detected only if the original file was modified in the
same commit. This implies that there will be a patch listed under the
original file name, and we would expect that clicking the original file
name in the file list warps the patch window to that file's patch. (If the
original file was not modified, the copy would not be detected in the first
place, the copied file would be listed as "new file", and this whole matter
would not apply.)

However, if the name of the copy is sorted after the original file's patch,
then the logic introduced by commit d1cb298 (which picks up the link
information from the "copy from" line) would overwrite the link
information that is already present for the original file name, which was
parsed earlier. Hence, this patch reverts part of said commit.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Johannes Sixt authored and Shawn O. Pearce committed Oct 20, 2007
1 parent 5dd57d5 commit 5e85ec4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -5221,8 +5221,7 @@ proc getblobdiffline {bdf ids} {
set diffinhdr 0

} elseif {$diffinhdr} {
if {![string compare -length 12 "rename from " $line] ||
![string compare -length 10 "copy from " $line]} {
if {![string compare -length 12 "rename from " $line]} {
set fname [string range $line [expr 6 + [string first " from " $line] ] end]
if {[string index $fname 0] eq "\""} {
set fname [lindex $fname 0]
Expand Down

0 comments on commit 5e85ec4

Please sign in to comment.