From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#67062: 30.0.50; [PATCH] Abbreviate the revision in 'vc-annotate' (for Git) Date: Thu, 14 Dec 2023 16:06:03 -0800 Message-ID: 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="15055"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67062@debbugs.gnu.org, juri@linkov.net To: Dmitry Gutov , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 15 01:07:25 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 1rDvjg-0003if-Ir for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Dec 2023 01:07:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDvjO-0006HM-VD; Thu, 14 Dec 2023 19:07:06 -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 1rDvjL-0006Gm-FK for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 19:07:03 -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 1rDvjL-00047B-50 for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 19:07:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rDvjK-0006v7-8s for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 19:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Dec 2023 00:07:02 +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.170259877226544 (code B ref 67062); Fri, 15 Dec 2023 00:07:02 +0000 Original-Received: (at 67062) by debbugs.gnu.org; 15 Dec 2023 00:06:12 +0000 Original-Received: from localhost ([127.0.0.1]:51208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDviV-0006u4-Kw for submit@debbugs.gnu.org; Thu, 14 Dec 2023 19:06:11 -0500 Original-Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:42331) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDviU-0006tr-5Y for 67062@debbugs.gnu.org; Thu, 14 Dec 2023 19:06:11 -0500 Original-Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1d075392ff6so489075ad.1 for <67062@debbugs.gnu.org>; Thu, 14 Dec 2023 16:06:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702598765; x=1703203565; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=7hdGjvpEsmPyOsCtjNkF9lHYgPWPOAQU+uU99f2EeTY=; b=YiL0qLuTzr2t/PCu7uinDsXBrb7c2LBl5cmuGwFZ8LwxNLSRUGvZGHtBEI4CTBV9e7 azNCXHK7MUL682HaJil8S1qoaocFyVib7ecT3SRVb7JRoPmJ6R4OlW+aTqxUm9LFqn0v Q9PArJEkWtmaglQdUS/yCdtz+/SXpfkwtDM0UKJpSDgNcqVfL6FApoTKD8nFVzJKkP/p BNXde5b2sVVcbPcox24E9b4jMTJ+BZomOvhUybwBRAQIfKcMPy9QS1yJ7q8Lbo486Bla eWcyvKt3xJ/yCq3a0tl7BZVo+uYsg+T6tHWOVKHi0N3dP2Da6SlfsG0XRZw6hmpKosLf rMuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702598765; x=1703203565; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7hdGjvpEsmPyOsCtjNkF9lHYgPWPOAQU+uU99f2EeTY=; b=l/0mNR/jLs9GeVoySOCeVzy50hFow9Q67oucfYCunLypzzxR5BqBZZ2kLkix9SqQh0 jmMxmsuTXhuHfxUsLw3rN9ebX2Fb08T38dZnOplQ0/4OaJAyY5gmoNUyeapc3t7D/0R3 KViLHud26algeyyTivfIUMTKMFyO/bh5MSpBo19ECnyh1IjQwaB2szmM7GA8HnROcic7 AkEeqOzCTaGSVECZVjeKeq2/NQuX7g60EwyPZSYSUL0Y1gUelr/Kb61vpmpIjv2ION62 RiWdxafd9NXKCqoue7ptjrehSS/GhObt5H4Rx1eyzIayeORj2/NSpr326UVh98qe6wIe DgNQ== X-Gm-Message-State: AOJu0YyQz6BerqtNct0cs9JqQdlKlb344YeaEby99DLqQGqZDqq7LZJp XtzcWV3lP3JotwPfm9DMZkk= X-Google-Smtp-Source: AGHT+IG7isT9/qi5TrUGQjTIuXwSlKTs/F6LftxOkPhezL5M7lvrsCDDZGGqwGSMYm2pVhBa+9lLXA== X-Received: by 2002:a17:903:24e:b0:1d0:4759:bb60 with SMTP id j14-20020a170903024e00b001d04759bb60mr15188900plh.26.1702598764534; Thu, 14 Dec 2023 16:06:04 -0800 (PST) Original-Received: from [192.168.1.2] (076-168-148-233.res.spectrum.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id e1-20020a17090301c100b001d33e65b3cdsm5482855plh.112.2023.12.14.16.06.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Dec 2023 16:06:03 -0800 (PST) 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:276231 Archived-At: On 12/14/2023 1:58 PM, Dmitry Gutov wrote: > Do we need this option? I'm probably missing something, but IIUC a new > variable to control the behavior was suggested as an alternative to > using a new backend action. But here we add a new backend action anyway. I had originally tried to do this purely with adding some variables and then using the existing backend functions. However, that would have resulted in 'vc-working-revision' returning either the full Git SHA or the short form depending on those options. I didn't think that would be a safe idea, since a) other callers of 'vc-working-revision' might not be prepared to handle short Git SHAs, and 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. All of those issues scared me enough that I wanted to avoid altering the behavior of 'vc-working-revision' in any way. 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.