From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Nicol=C3=A1s?= Ojeda =?UTF-8?Q?B=C3=A4r?= Newsgroups: gmane.emacs.bugs Subject: bug#55871: Acknowledgement (27.1; vc-git.el log view 'a', 'f', 'd' do not work when following renames) Date: Mon, 12 Dec 2022 17:44:27 +0100 Message-ID: References: <78f97339-2aca-0dbd-4cb4-3532af78a895@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3165"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 55871@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 12 17:45:40 2022 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 1p4lvw-0000b2-Co for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Dec 2022 17:45:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4lvN-0000UI-DB; Mon, 12 Dec 2022 11:45:05 -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 1p4lvK-0000To-Ji for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 11:45:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4lvK-0000Nj-9K for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 11:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p4lvK-0000gi-3j for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 11:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Nicol=C3=A1s?= Ojeda =?UTF-8?Q?B=C3=A4r?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Dec 2022 16:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55871 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 55871-submit@debbugs.gnu.org id=B55871.16708635002622 (code B ref 55871); Mon, 12 Dec 2022 16:45:02 +0000 Original-Received: (at 55871) by debbugs.gnu.org; 12 Dec 2022 16:45:00 +0000 Original-Received: from localhost ([127.0.0.1]:54022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4lvI-0000gE-9A for submit@debbugs.gnu.org; Mon, 12 Dec 2022 11:45:00 -0500 Original-Received: from mail-yw1-f180.google.com ([209.85.128.180]:35741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4lvG-0000g7-Pr for 55871@debbugs.gnu.org; Mon, 12 Dec 2022 11:44:59 -0500 Original-Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-3b5d9050e48so154842457b3.2 for <55871@debbugs.gnu.org>; Mon, 12 Dec 2022 08:44:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aCs4K3CkrOcHNjJ4VEJTMk0y7zXij380Y1ciUsVzDUs=; b=B4OGxcsUvEHl6AKUsYbgbYIfPDJ8UI8E+oCBRG7sNF3dquwllTCmLfQgoGew6ZDEOS FkSa9sa1hiNQdRslfCxyIXvKRyGegcSSGioyiyAy9A0LuqohSvr240k/lT8Sf3//oSGD UgQwUyPrHrK+oaysUMbUxyhngHGCdLlw6dpRClB4zEdaI/jBzqrcbRhvMns7pmN8LAJD H0CHUOUmGntQ6mt+cFviiTtWH9wIaQUD7qZLXQd6viS82dX21/0G9f2tDJMOuAIqOYUH 1zCIwBNoTr0Q3tR9fOPxcx7K0atig9UBLdfcrVg4iDq3gROOVEZqxPIXZgVh3VNzpagA F3iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aCs4K3CkrOcHNjJ4VEJTMk0y7zXij380Y1ciUsVzDUs=; b=03W3hI10kBbEBV6ZI8vVOCDYkiwueB3KjZQ+X4xsBMzSKSLmgCXXz2/Xle3s6b6mOg +7U+ut/POBTOECy42X2/i4AHg6WMciPpyZBvpak1WE7scXkCUOkQh91r762UMPhzqR0h ybVsj+q93ztvKUgkMucfc6ZstuwwU4BwjYhaO2iw5A6osVXUt2o2lMTrnGqn9Bb9XStf etM8jsNcnNHrTVFYNxseegBcjTRgkCCeq6vZnTiGk0p3qbxA2WiS6JUYKoDXBc6vEHPh taeiOup0OobklkPYngvA5W+CNJN0TOIhEcLuC6dlKPB4NLpvB3CyJ0teWUzgL7ni04T1 3CRw== X-Gm-Message-State: ANoB5plm6eSYP6OJR1E5xtZxpsuM91qvz/3LtDcZUVT5EPVQbgxM6vH0 hgrufkAlErLsZrRuvywkGrg0etOhEiMGhj9mClM= X-Google-Smtp-Source: AA0mqf6pcwaDS1ff3v0TsRFbbhd89eIUuM7fyscZp1SmtvPBaqMW2kXA1l2+tnX9WqvlO9aQPQKCLGRPuMVDAOQixDM= X-Received: by 2002:a81:1044:0:b0:3d4:9cd5:353c with SMTP id 65-20020a811044000000b003d49cd5353cmr37782691ywq.394.1670863493085; Mon, 12 Dec 2022 08:44:53 -0800 (PST) In-Reply-To: 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:250719 Archived-At: Dear Dmitry, Apologies for the delay in getting back to you; I have been submerged in my day job and haven't had any time to look at the code again (the copyright assignment is done, by the way). I read your message, and I think immitating GitHub's UI is a great idea, as it liberates us from having to do any kind of "pretreatment" of the git log (which can be expensive for large repos). We should focus in this direction to fix this issue. If I get some spare time over the holidays I will try to take a look (sadly, I cannot promise that will be the case...). Cheers, Nicolas On Mon, Dec 12, 2022 at 12:02 AM Dmitry Gutov wrote: > > On 18/08/2022 05:10, Dmitry Gutov wrote: > > I experimented with --follow myself in the past, and it is annoying in > > that it skips commits, some of which are visible in the log when you > > don't use --follow, details here: > > https://stackoverflow.com/questions/46487476/git-log-follow-graph-skips-commits > > > > So I figured the approach in (3) has something to do with it. But it > > seems not to be the case. > > I've tried another idea: to pre-process the file's history and pass all > historical file names to 'git log' inside vc-git-print-log. > > Unfortunately, that delays the appearance of the log significantly. In > the Emacs repo that comes down to several seconds, which seems > unacceptable. But that would fix both the problems with a/f/d and the > bug described in the SO question above. > > Looking around for how other software deals with it, it seems GitHub has > found a satisfactory solution which adds a new UI element with basically > zero performance cost. > > At first it was implemented in a Chrome extension for it > (https://github.com/jeffstieler/github-follow-extension), but then added > to the core functionality this summer > (https://github.blog/changelog/2022-06-06-view-commit-history-across-file-renames-and-moves/). > > This gif shows the workflow: > https://i0.wp.com/user-images.githubusercontent.com/4021812/171795153-4f327a04-eb27-4d46-acb1-73d2e82ce4c5.gif?ssl=1 > > We should be able to do something similar. > > Step 1: Drop the '--follow' argument in all cases. > > Step 2: After the log is finished printing, we detect somehow that the > last commit was a rename one. Perhaps using an additional process call, > or perhaps by adding some output to the process which we'll hide through > font-lock or process filter. When it is a rename, we print a message at > the end, saying the file has been renamed. And a button saying e.g. > "Print Previous Log", which would print the history for the previous > name. That history should also include the missing commits from the SO > question. > > Not sure how to deal with duplicating file names best (like etc/NEWS has > been the name of many files in the Emacs repo): either limiting the > first revision to start from -- but that keep bring back the missing > commit problem, oh well -- or some other way. > > Can't exactly check what GitHub is doing, because they don't actually > provide this for NEWS.24, guess because it was not a straight rename: > https://github.com/emacs-mirror/emacs/commits/master/etc/NEWS.24 > > But > > git log -M50% -C --stat 5f8947c7007d1d8 -n 1 > > at least detects it as a copy if not a rename. Guess they didn't adopt > the whole follow-renames logic, and we can do better. > > I don't have any code to show, but it shouldn't require too many changes.