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#67062: 30.0.50; [PATCH] Abbreviate the revision in 'vc-annotate' (for Git) Date: Fri, 15 Dec 2023 02:15:16 +0200 Message-ID: <2d4c9afe-259b-e837-6bb5-df7cd9c5974f@gutov.dev> References: <66fc4912-6aa5-79da-bd6f-52f068cf1a77@gmail.com> <83y1f4wxby.fsf@gnu.org> <2eb31324-ae24-db4b-4f62-a0140bfb9f81@gutov.dev> <83sf5bv77j.fsf@gnu.org> <83bkbzusri.fsf@gnu.org> <86msvi95aw.fsf@mail.linkov.net> <8742d731-62ba-0808-bdc6-cbad1cf98116@gutov.dev> <2f7c9164-4a64-91c6-245e-61208de8560c@gmail.com> <868r72895g.fsf@mail.linkov.net> <83o7fxu458.fsf@gnu.org> <10fbafbc-fad9-6738-1146-c37c61e7b1e3@gmail.com> <83o7espnp3.fsf@gnu.org> 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="17406"; 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 Cc: 67062@debbugs.gnu.org, juri@linkov.net To: Jim Porter , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 15 01:16:28 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 1rDvsQ-0004ID-N2 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Dec 2023 01:16:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDvsB-0007fy-Dv; Thu, 14 Dec 2023 19:16:13 -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 1rDvs7-0007fZ-Jt for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 19:16:07 -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 1rDvs2-0000UQ-Ix for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 19:16:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rDvs1-00014A-Pg for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 19:16:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Dec 2023 00:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67062 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67062-submit@debbugs.gnu.org id=B67062.170259933032452 (code B ref 67062); Fri, 15 Dec 2023 00:16:01 +0000 Original-Received: (at 67062) by debbugs.gnu.org; 15 Dec 2023 00:15:30 +0000 Original-Received: from localhost ([127.0.0.1]:51213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDvrV-0008QO-OQ for submit@debbugs.gnu.org; Thu, 14 Dec 2023 19:15:30 -0500 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:56697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDvrT-00087e-Kk for 67062@debbugs.gnu.org; Thu, 14 Dec 2023 19:15:28 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 82B6D3200B1C; Thu, 14 Dec 2023 19:15:21 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 14 Dec 2023 19:15:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :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=1702599321; x=1702685721; bh=8wMfXL+CJUo1+XRrLyH61T3D4INdBB0rsjcPchMf7JA=; b= tkI8wcg0C06H6lW1uIaBrixSKHx1uoUOzl4fBaLFTuLp7TIGIcUyuXaZNrs5NIYS lktO5p9mkTXsu/JZFVKbw/tOfE9xQzBwfk709GoOiPSF2lPSz/U+gBn1e4g5e7WP kYA9Wnr/sEHGcaVoOmewUzvO+YW9cHJ1pZrh4MniqA6+DAot5HjPhAl6ADAtHvIL hRKTHBmVBxMlu5+6VVyOfsxwERLvUcJSxxdZZi5bu2LjkN8S1m3y0lshiWF1dzJ0 QkQzmc0Sm8UaTJTKXOgh5deKvQLzI4E5b6Krkex2NrZZ5yA6p4j/gO5YZlUzcXna VTyaLmHAZVm1/P2GEtqCng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1702599321; x= 1702685721; bh=8wMfXL+CJUo1+XRrLyH61T3D4INdBB0rsjcPchMf7JA=; b=F ABBVXi3M3SXsuoPaHPF8MXdTXmPaf2DKJ7v1Pxixs6ecW88l6WsnP+JlonmxeAnA 8tYmTtw3ZZr10kh0JWsmdfoscG9jFbtKn/B9Jyhs3fO1e4/tEN8nAjNr/Pj8RiG0 VVIjz1m2066IpvRLYTUREoapTNAqlNDlmiO1pZ2QVeQg+2c0BvmXqrx19d2pqC/e hmcEvMqlRGxiEn3LpbDYtnRd8l2EJrmpK2w+KKQFEj1QqXVmRgj5i5WVzBnjA1p+ 88IxUqBdxsVFnzfrHyBBb91wyriXvkudm6siTay3/aCGboMyMb8VhAzrA8offK6B qaA2Nk/IiPENhVfZJZezQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddttddgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 14 Dec 2023 19:15:19 -0500 (EST) Content-Language: en-US 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:276232 Archived-At: On 15/12/2023 02:06, Jim Porter wrote: > b) 'vc-working-revision' caches the revision, so it's not as easy as > just setting a variable that controls the behavior: you'd need some > special logic for invalidating the cache, or perhaps ignoring the cache > when 'vc-use-short-revisions' is non-nil or something. That makes sense indeed. But you could add a new function vc-short-revision and a variable vc-use-show-revisions, where the latter would be obeyed by vc-git-working-revision only. vc-short-revision could call (vc-call-backend backend 'working-revision file) directly (with vc-use-show-revisions bound to t), since it doesn't seem to really need caching, at least in the current usage. Or it could create its own cache. > While this patch > does add a new backend action, it's purely optional and no other backend > needs to be aware of it at all. I suppose I could hardcode the Git > behavior in 'vc-short-revision', but that didn't seem to me to have any > benefits over this version. I agree that the new backend action 'short-revision' (unique to Git) is not a problem. I'm just saying that 'vc-git-use-short-revisions' might be unnecessary. It's possible, I suppose, that some users might prefer long revisions instead of short ones (in the buffer name for vc-annotate), but we could wait for such requests to show up first.