From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67062: 30.0.50; [PATCH] Abbreviate the revision in 'vc-annotate' (for Git) Date: Sun, 12 Nov 2023 08:03:44 +0200 Message-ID: <83sf5bv77j.fsf@gnu.org> References: <66fc4912-6aa5-79da-bd6f-52f068cf1a77@gmail.com> <83y1f4wxby.fsf@gnu.org> <2eb31324-ae24-db4b-4f62-a0140bfb9f81@gutov.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39357"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, 67062@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 12 07:04:57 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 1r23aa-0009vg-BO for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Nov 2023 07:04:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r23a6-0007Jc-Dj; Sun, 12 Nov 2023 01:04:27 -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 1r23a2-0007Iy-7Z for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 01:04:24 -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 1r23a1-0006pO-D2 for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 01:04:21 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r23af-0004sD-MY for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 01:05:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Nov 2023 06:05: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.169976909318717 (code B ref 67062); Sun, 12 Nov 2023 06:05:01 +0000 Original-Received: (at 67062) by debbugs.gnu.org; 12 Nov 2023 06:04:53 +0000 Original-Received: from localhost ([127.0.0.1]:54959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r23aX-0004ro-FD for submit@debbugs.gnu.org; Sun, 12 Nov 2023 01:04:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r23aU-0004rZ-DY for 67062@debbugs.gnu.org; Sun, 12 Nov 2023 01:04:51 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r23Zj-0006nz-U2; Sun, 12 Nov 2023 01:04:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cUtvSi8eVKkbXnuilzzR66zZoeEQWa12e4toL0LbI60=; b=lpz+AnibRLm+ 3b7wF0rycHLGVPPvvPhdI/CQb4eaprO9J7coX1cNyGRhmi4JtLkzhNsCjGHsIBEuMV4FetiXMHvQC iCmkjykRDRt3AYZM/xQs3o1hh8RK0QjO39q3ogecZPHUMU3GoTD/eQn07H3/kYoP1ZIM2vf9Tmwm4 N42BYEU/a1EWA1NfFLGjiyXmuM6TacJAmVs1sm4JrwMV38mIa8aMXJFQfXuZMMCpMxJPZhc/t4aNh zf8h1Em+SuXBSO7ncBjNNYpyDHNRtgcAD4b9uifY4fhCUUrICWuhR+NU7V7a/GwShMEnhHtfbt9W4 LTIGXJG7Kd2prLphazPtdg==; In-Reply-To: <2eb31324-ae24-db4b-4f62-a0140bfb9f81@gutov.dev> (message from Dmitry Gutov on Sun, 12 Nov 2023 00:00:13 +0200) 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:274186 Archived-At: > Date: Sun, 12 Nov 2023 00:00:13 +0200 > Cc: 67062@debbugs.gnu.org > From: Dmitry Gutov > > On 11/11/2023 09:41, Eli Zaretskii wrote: > > If this is a Git-only issue, perhaps it would be better to have a > > Git-only option, instead of defining a whole new VC method? > > Our general approach is to prefer global options and dynamic dispatch on > backends, resorting to using per-backend options when it's much easier > to do. Which I think is the case here. What other VC backend has such long revision strings? I couldn't think of any. And for Git, there could be the choice of either shortening the SHA1 signature or using what "git describe" returns. Which is why I suggested an option specific to vc-git. > In this case it might actually be more difficult to go the second route > since the intention is to only use the short hash in this particular > place. vc-annotate is common code and it will need to indicate that > intention to the backend somehow. I'm not sure I follow. All we need is a new function to call instead of vc-working-revision, that's all. That new function will indicate the intention to the backend. Sounds easy enough. IOW, if Git is a special case, there's IMO nothing wrong with having code that is specific to Git. Inventing a VC method that will do nothing in every VCS but Git sounds un-economical and not very elegant to me, FWIW.