From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#35624: log-view-diff regression Date: Thu, 16 May 2019 00:12:54 +0300 Organization: LINKOV.NET Message-ID: <87lfz7o05l.fsf@mail.linkov.net> References: <87pnou2ak2.fsf@mail.linkov.net> <051f40d7-206b-e5b5-f0b7-2354d0552dcf@yandex.ru> <874l64raeu.fsf@mail.linkov.net> <87imujju04.fsf@mail.linkov.net> <7a87f334-1d60-9d39-959c-97dbad690fc3@yandex.ru> <875zqgaekq.fsf@mail.linkov.net> <9e4ac5c6-af62-f907-dc30-a85a1ba6bd23@yandex.ru> <87y33a3x6k.fsf@mail.linkov.net> <87bm04vky9.fsf@mail.linkov.net> <5a4d3875-5cb5-bc84-c72e-d1840aa8d7c3@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="162586"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 35624@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 15 23:55:25 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hR1rw-000gBY-SX for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 May 2019 23:55:25 +0200 Original-Received: from localhost ([127.0.0.1]:43286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR1rv-0005Me-ST for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 May 2019 17:55:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR1ri-0005Hb-En for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 17:55:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR1rd-0007qp-5S for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 17:55:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40000) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hR1ra-0007kk-UZ for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 17:55:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hR1ra-0002zG-SR for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 17:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 May 2019 21:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35624 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35624-submit@debbugs.gnu.org id=B35624.155795729711454 (code B ref 35624); Wed, 15 May 2019 21:55:02 +0000 Original-Received: (at 35624) by debbugs.gnu.org; 15 May 2019 21:54:57 +0000 Original-Received: from localhost ([127.0.0.1]:53541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hR1rV-0002yf-CS for submit@debbugs.gnu.org; Wed, 15 May 2019 17:54:57 -0400 Original-Received: from bird.maple.relay.mailchannels.net ([23.83.214.17]:20476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hR1rS-0002yQ-PM for 35624@debbugs.gnu.org; Wed, 15 May 2019 17:54:55 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7BB958C19E5; Wed, 15 May 2019 21:54:53 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a19.g.dreamhost.com (100-96-6-25.trex.outbound.svc.cluster.local [100.96.6.25]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B1BA98C17A4; Wed, 15 May 2019 21:54:52 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a19.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Wed, 15 May 2019 21:54:53 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Abaft-Eyes: 515da3d04f4e5648_1557957293302_2316896765 X-MC-Loop-Signature: 1557957293302:2669079384 X-MC-Ingress-Time: 1557957293302 Original-Received: from pdx1-sub0-mail-a19.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a19.g.dreamhost.com (Postfix) with ESMTP id 797A381400; Wed, 15 May 2019 14:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=sWmAXp4AgrxpZTlSmG8eLH2nCQ4=; b= NW6n1hbPkBUGYi8mQFa9AaoQ1TXeFRZU2jcBL2y1A4RiX/ctz5DPGIAlrX7bY+hm MHL6biyCm73tlBFAV/CJQBwgVF+Gqt6vMy/B9G95Uvi39G9UpJZoHbeM0pqSkHBr gvBU0apURQuKzb75mr2QGF5XNNZ3jpp+e6p/9dZXJQ8= Original-Received: from mail.jurta.org (m91-129-96-230.cust.tele2.ee [91.129.96.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a19.g.dreamhost.com (Postfix) with ESMTPSA id 6C54480AF2; Wed, 15 May 2019 14:54:46 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a19 In-Reply-To: <5a4d3875-5cb5-bc84-c72e-d1840aa8d7c3@yandex.ru> (Dmitry Gutov's message of "Wed, 15 May 2019 03:34:24 +0300") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrleelgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledrleeirddvfedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirddvfedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughguhhtohhvseihrghnuggvgidrrhhunecuvehluhhsthgvrhfuihiivgepud X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159361 Archived-At: >> I don't remember what VC backend produced such header, maybe >> vc-bzr or vc-svn. Or probably vc-cvs because CVS has the same >> header as RCS, and I can easily check what headers RCS produces >> because it doesn't require any configuration. For brevity >> only essential part of RCS log is left here for demonstration: > > Thank you. > >> Working file: > > I guess RCS at least outputs some pertinent information here, not just that > text, so it's less puzzling. I don't know how useful it is, though. Yes, RCS displays a multi-line header. >> ---------------------------- >> revision 1.4 >> ---------------------------- >> revision 1.3 >> ---------------------------- >> revision 1.2 >> ---------------------------- >> revision 1.1 >> >> When the beginning of the region is on the "Working file" line >> in the header, and the end of the region is on a revision line, >> e.g. "revision 1.4", then typing `=' displays: >> >> No changes between 1.4 and workfile > > You can also type 'C-u C-x v =', then '1.4', RET and C-j to omit the end > version. That would also show the diff against the workfile. 10 keys more to type. >>>> + (with-current-buffer buffer >>>> + (insert "Working\n") >>> >>> How does the result look? Just the word "Working" at the beginning of >>> the buffer? >> >> If the word "Working" is too ambiguous, then at least an empty line >> at the beginning of the buffer will enable this feature for Git. > > Should we really make the log look weirder for the sake of a feature one > would use at most, I don't know... once a month? When this feature was enabled, I used it every day. Currently I'm forced to type 10 more keys every time. I agree the log not to look weirder, so better to not display Working. >> and if the current workfile has some changes, then differences >> between 1.4 and workfile are displayed. >> >> This means that RCS supports this nice feature, but Git doesn't. > > Just how nice is it, really? It seems pretty niche to me, and I don't > remember the last time I needed something like this exactly. Or course, you didn't think about it, because you didn't know it exists. I didn't know too until discovered it accidentally. After that it hard to lose this ability. The problem is that this useful feature is undocumented. Here is the patch that documents it: diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 4986c11103..12cee5d922 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1033,6 +1033,7 @@ VC Change Log Visit the revision indicated at the current line. @item d +@itemx = Display a diff between the revision at point and the next earlier revision, for the specific file. @@ -1047,6 +1048,16 @@ VC Change Log revision at point. @end table +To compare two arbitrary revisions, activate the region: set the +beginning of the region to the line with the first revision and the +end of the region to the line with the second revision to compare, +then type @kbd{d} or @kbd{=}. When the beginning of the region is on +the top line that has no revision, it uses the current work file as +the first revision to compare. When the end of the region is on the +bottom non-revision line after the last revision line, then it uses +the next earlier revision after the last displayed revision as the +second revision to compare. + @vindex vc-log-show-limit Because fetching many log entries can be slow, the @file{*vc-change-log*} buffer displays no more than 2000 revisions by diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 61c13026cc..b6feb3b8d1 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1017,8 +1017,8 @@ vc-git-print-log ;; If the buffer exists from a previous invocation it might be ;; read-only. (let ((inhibit-read-only t)) - (with-current-buffer - buffer + (with-current-buffer buffer + (insert "\n") (apply 'vc-git-command buffer 'async files (append