From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!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: Wed, 13 May 2020 04:36:37 +0300 Message-ID: <9961b9c6-e39b-d6f9-5d5b-a0e3de5b12c7@yandex.ru> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="42814"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.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 Wed May 13 03:37:10 2020 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 1jYgKc-000B17-43 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 May 2020 03:37:10 +0200 Original-Received: from localhost ([::1]:34544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYgKb-0007eu-70 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 May 2020 21:37:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYgKU-0007dk-Sc for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 21:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45427) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYgKU-0008J9-Jm for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 21:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYgKU-0000N1-H4 for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 21:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 May 2020 01:37: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.15893338211416 (code B ref 39044); Wed, 13 May 2020 01:37:02 +0000 Original-Received: (at 39044) by debbugs.gnu.org; 13 May 2020 01:37:01 +0000 Original-Received: from localhost ([127.0.0.1]:56973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYgKF-0000MX-Hz for submit@debbugs.gnu.org; Tue, 12 May 2020 21:37:01 -0400 Original-Received: from mail-wr1-f68.google.com ([209.85.221.68]:42005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYgKD-0000MK-LH for 39044@debbugs.gnu.org; Tue, 12 May 2020 21:36:46 -0400 Original-Received: by mail-wr1-f68.google.com with SMTP id s8so18674986wrt.9 for <39044@debbugs.gnu.org>; Tue, 12 May 2020 18:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tbvaCvUra1cmZeXZ2cLoZj2/AB8aL55W+Mr87esQWVA=; b=K2FY8SIJlKPr1liu46dRUnkyqNiCuP8JPT5GaY9zwkvptuKuUvj34VtLTAp/qpapaY XL6k2bb2PLdUeUUrsdwADklGucZ5A/nAOwRGm3uOzsPLq+TG3Htjh5RUxQSyZgSbCr2V Z0/wzqmlPG0QyyxI/6MqT+ee5IV1T8ay8kHa7i6SG/22PJ85TqNN26QQeHkXpQl4ZYe5 o/dkkO6izgXHcPjWfiwvPyV18BoyOAfWA9WL9vYmbqx8PE1UmNFvd8uxcA3tkoi+Ivl4 m3gOt49Qsv6S597IOrPG6qcoWUUDi/DAe6/ejzuP2plRXrmi1vFVio5lY8OQYpDKHydD FOnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tbvaCvUra1cmZeXZ2cLoZj2/AB8aL55W+Mr87esQWVA=; b=dptSfsWOQDsTKmj342ylL5U5SPghCx7mya6YqxLc6i6FdQfidasbsusyQdLmV6OhdA YG4SGsHfwsKPrXOAcMu0MPkeoJXzohoS9hiWLmpNZp65eGtxL65CtveAfDgCAycIbHI8 F+ReakGFa4UpOzloPlVUhQm4WuzTPIVA+nrYmbYkiKFp9oJPsjOydmm3UTOjb3qfqXph M0T8j7EWBP/uHq8NkCdsIdK66il0FANZ52biR4/cSETs3JbgiUHjjTkiXn03Lem5fSd/ 13KzcSXdMSy55yj/5JJaGmA0Zl3SzYnYDYRfbjtqYAyDKhqb9mdQMtjtbDxrk1e8i6MJ b+bg== X-Gm-Message-State: AGi0PubND1VRgb8ys+tEztIa9FmkkYobqc2EUiQ+TEhWzEamh3/DK6bu SXJDl5Bs2gzbAFqKeCcXhfDqi7oQ X-Google-Smtp-Source: APiQypJQhOx5VqIsE2B2p5QAxztcCYTSufBSTnDMGONub0Ozlreo87NxLIsJsmcENetO5MLz5hoxJQ== X-Received: by 2002:a5d:6b90:: with SMTP id n16mr10235307wrx.220.1589333799398; Tue, 12 May 2020 18:36:39 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id k131sm1275785wma.2.2020.05.12.18.36.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 May 2020 18:36:38 -0700 (PDT) In-Reply-To: Content-Language: en-US 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" Xref: news.gmane.io gmane.emacs.bugs:180137 Archived-At: 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.