{"thread":{"id":"10289","subject":"[PATCH resend] gitk: Do not pick up file names of \"copy from\" lines","startedAt":"2007-10-15T10:08:08Z","lastAt":"2007-10-15T10:08:08Z","messageCount":1,"participants":["Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"55844","messageId":"47133C08.4050403@viscovery.net","threadId":"10289","inReplyTo":null,"subject":"[PATCH resend] gitk: Do not pick up file names of \"copy from\" lines","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2007-10-15T10:08:08Z","receivedAt":"2007-10-15T10:08:08Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <johannes.sixt@telecom.at>\n\nA file copy would be detected only if the original file was modified in the\nsame commit. This implies that there will be a patch listed under the\noriginal file name, and we would expect that clicking the original file\nname in the file list warps the patch window to that file's patch. (If the\noriginal file was not modified, the copy would not be detected in the first\nplace, the copied file would be listed as \"new file\", and this whole matter\nwould not apply.)\n\nHowever, if the name of the copy is sorted after the original file's patch,\nthen the logic introduced by commit d1cb298b0b (which picks up the link\ninformation from the \"copy from\" line) would overwrite the link\ninformation that is already present for the original file name, which was\nparsed earlier. Hence, this patch reverts part of said commit.\n\nSigned-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\n   I did not see this appear in http://git.kernel.org/?p=gitk/gitk.git\n   so I assume it got lost in the noise, and resend it.\n\n   -- Hannes\n\n  gitk |    3 +--\n  1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex b3ca704..1306382 100755\n--- a/gitk\n+++ b/gitk\n@@ -5216,8 +5216,7 @@ proc getblobdiffline {bdf ids} {\n  \t    set diffinhdr 0\n\n  \t} elseif {$diffinhdr} {\n-\t    if {![string compare -length 12 \"rename from \" $line] ||\n-\t\t![string compare -length 10 \"copy from \" $line]} {\n+\t    if {![string compare -length 12 \"rename from \" $line]} {\n  \t\tset fname [string range $line [expr 6 + [string first \" from \" $line] ] end]\n  \t\tif {[string index $fname 0] eq \"\\\"\"} {\n  \t\t    set fname [lindex $fname 0]\n-- \n1.5.3.716.gb8ce0-dirty\n"}]}