From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#39044: 27.0.50; On git log-view-diff does not work for moved files. Date: Thu, 14 Dec 2023 03:23:35 +0200 Message-ID: <82fa7939-8914-0dd4-ef6c-e3d100aa1dc6@gutov.dev> References: <9961b9c6-e39b-d6f9-5d5b-a0e3de5b12c7@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22843"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: David Koppelman , 39044@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 14 02:25:02 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rDaTF-0005fe-9P for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Dec 2023 02:25:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDaT2-00016o-UO; Wed, 13 Dec 2023 20:24:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rDaT0-00016b-I4 for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 20:24:46 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rDaT0-00078J-AH for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 20:24:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rDaTG-0000te-IP for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 20:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Dec 2023 01:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39044 X-GNU-PR-Package: emacs Original-Received: via spool by 39044-submit@debbugs.gnu.org id=B39044.17025170433371 (code B ref 39044); Thu, 14 Dec 2023 01:25:02 +0000 Original-Received: (at 39044) by debbugs.gnu.org; 14 Dec 2023 01:24:03 +0000 Original-Received: from localhost ([127.0.0.1]:59922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDaSJ-0000sJ-E8 for submit@debbugs.gnu.org; Wed, 13 Dec 2023 20:24:03 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:57079) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDaSG-0000rg-KA for 39044@debbugs.gnu.org; Wed, 13 Dec 2023 20:24:02 -0500 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 5ADFC5C0337; Wed, 13 Dec 2023 20:23:38 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 13 Dec 2023 20:23:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1702517018; x=1702603418; bh=zzkgi9DeF4ZrAxp89gmHlCyyg7WfQwzqVMFAir0tNn4=; b= 1IRgctcgSEqXW7BAJGSfineYO2BaAOqqXaglJkXfTUIX326e8FASIwJOlkK+S7cp +O3mx8hmNpuQQQpJ9mtaq577Ud/wW0MLszt3ctX0knZITlmx4TkPLiDqY7eoVJTH eBMqIoPYogIrl9ljqI9SqS7we21jr2+4Ykp4jkrFQ7S2mEf9dNfsK+rPryXezp9d R1iBxCNojB2dFbGl0fWq3DyAAjb0p/+K8qMTP0Jz3aVbPtlPL1I7chXhJ8vj4CBu WFeY/z454frx3g5KaYisARvBr+1t0XbD3u7K/Ve3HkPRzG8AuJVzzRyRJqCwmBk5 Ccnabr7x9iHpYJDHEoB4KA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1702517018; x= 1702603418; bh=zzkgi9DeF4ZrAxp89gmHlCyyg7WfQwzqVMFAir0tNn4=; b=h nAxzr/sW/58FVc2VOjS3GwaEmfUGlma35B/3NxOTdgLN1aF0n9Eyqr5M1moG0Fpz aGl0OmyNKeVeJnDn4Dvmloi4XC2ivFJ4v1YHV5iKdOnhbER2Y+zgmOS10a8CsVWk MrKLhj5rkGN6S+y3MXzdCwSSK+EqqaeXNvWemcwkNz8KbEhL4HPk0iEj3nwHK+qA EX8LEgE+BQlh32EEs7UDA/BudjUSYmmhxmXcHcKwGVICWsA4UVbuymkypc9AkNes 3yLn73julTwkmlnSKY6UcRxrdE6/bdLUriQPvxzcEHbZd18g++AEH0T3WNKAmF8O 4WZ05OTaEb+OQQdIqloQQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudelkedgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffhvfhfjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeduteetleetkeegveeileduveekleffleeuvddtgefgiedtjeeltdeikeehieeg gfenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Dec 2023 20:23:37 -0500 (EST) Content-Language: en-US In-Reply-To: <9961b9c6-e39b-d6f9-5d5b-a0e3de5b12c7@yandex.ru> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276165 Archived-At: On 13/05/2020 04:36, Dmitry Gutov wrote: > On 08.01.2020 22:48, David Koppelman wrote: >> >> With (setq vc-git-print-log-follow t) visit a file in a git repo that >> was moved from some other directory and which had changes when in that >> other directory. Start log view, C-x v =, move the cursor to a commit >> made in the file's former location, and press d (log-view-diff). Rather >> than showing a diff, a message reporting no changes is shown. > > I usually give up and press 'D' in those cases (diff for the whole tree). > >> This flaw was noted in bug 8756, covering vc-diff/log-view, but was >> left to a follow on bug. >> (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8756). >> >> Interestingly, vc-annotate has no trouble with renames. See >> commit d1e4c4037e88f3256db19813805d03f8ad0291fa. > > vc-annotate is fine because 'git blame' includes the previous file name > in the output. Not so for 'git log' by default. > > Looking at this issue for some time, I haven't found an easier way to do > this rather than: > > 1. When vc-git-print-log-follow=t, also add the --name-status argument > to the command invocation. > > 2. Hide this new text from the user using font lock by adding some rules > to vc-git-log-view-mode. > > 3. _Probably_ teach log-view-current-file how to determine the current > file name. _Maybe_ via log-view-file-re. Some come would also need to > set log-view-per-file-logs to t for per-file Git logs. It could also be > made into a backend method instead. > > See also bug#13004 for the same problem when using Hg. It could use the > same approach, but the solution is more questionable since '--stat' > seems to noticeably slow it down. I have now posted a somewhat related solution to https://debbugs.gnu.org/55871#41. Except it requires vc-git-print-log-follow to be disabled, and has virtually no runtime overhead. And it works when a fileset contains several files, not just for singles (a rare case, though). Feedback welcome. And maybe these bug reports should be merged, actually, since the complaint is more or less the same.