From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#63470: [PATCH] Use faster option for running vc-hg status Date: Wed, 17 May 2023 07:47:09 -0400 Message-ID: References: <83h6shbaiv.fsf@gnu.org> <83bkiobwsu.fsf@gnu.org> <83o7mjxk3i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000194be605fbe2402d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30619"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , 63470@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 17 13:48:35 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 1pzFdy-0007ks-5u for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 May 2023 13:48:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzFdk-000866-4v; Wed, 17 May 2023 07:48:20 -0400 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 1pzFda-0007yj-45 for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 07:48:13 -0400 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 1pzFdT-0007tQ-15 for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 07:48:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pzFdS-0003Tu-Tf for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 07:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 May 2023 11:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63470 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 63470-submit@debbugs.gnu.org id=B63470.168432404813215 (code B ref 63470); Wed, 17 May 2023 11:48:02 +0000 Original-Received: (at 63470) by debbugs.gnu.org; 17 May 2023 11:47:28 +0000 Original-Received: from localhost ([127.0.0.1]:49173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzFcu-0003R5-3p for submit@debbugs.gnu.org; Wed, 17 May 2023 07:47:28 -0400 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:55611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzFcr-0003Qr-S5 for 63470@debbugs.gnu.org; Wed, 17 May 2023 07:47:26 -0400 Original-Received: from mail-yw1-f199.google.com ([209.85.128.199]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) (Exim 4.96) id 1pzFcl-009L81-1j for 63470@debbugs.gnu.org; Wed, 17 May 2023 07:47:20 -0400 Original-Received: by mail-yw1-f199.google.com with SMTP id 00721157ae682-5617e3442cbso8785967b3.0 for <63470@debbugs.gnu.org>; Wed, 17 May 2023 04:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; t=1684324040; x=1686916040; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rwql9Hyr1B0M4i1fb0s15qqjgr8qIzcL1y0ZdrWTKGw=; b=Tb7ntbPZRNCC1/JTrSLaQHEjfnGrw7pUtflJQLd7/yH2l3rTquNlu2qM7wBBDutnZb VXMjtDrAsw2LUUCLiDDfOisQcPxsd0E7QcBG6++8AA8DffR1q0sXSYiSxW7lDctXkMJA dPqJplX0zPIM7HD3s6TnTh5Nx5yRxFxBr1Bpo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684324040; x=1686916040; 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=rwql9Hyr1B0M4i1fb0s15qqjgr8qIzcL1y0ZdrWTKGw=; b=QwMEIN+CqFUzAiP0rGeZpuuxIGXzUt8OmkhvNQgDbzox91MF9LvUhg27j/GcLSZaOX pTYC/QkzXvjH69ibDiZziYV0Sa3I1dbih7OfSulA21iwgU0twndr2xBHVKZ2cGn/MFIt 9Vifn+Xj/AAlA3sLS2xK8o4h9t+3eVDuD8PMrsepORHwh+fKJUOwAqKfRiFBriYM+j+E INQk4IosTWEVI2AmI2k4yK1KJCcGMDMPX11Y8GGPW8FyBfCpWaNZqHZyV2PMFJ4gGRbc OhKQfKinxQLqpdeFzkskuePAdWE5D83TodqOX1aRI8RiKB5rUsxQ+VjacAhmcekgYNlV mJRg== X-Gm-Message-State: AC+VfDwM3m5n3dVK7Ekh0Z5ZbB+BuVLxOx9RmM1sySbdbqFSumQhQT1y En/+TOCG/SgJk/Y/Wf8a2aLk0/feqq7JtLtrzd74xMEBfvHlUt55FAfXw4l3S13AMGCdjrPwJsY BGThSDYgrh7npIR0CjYaFM2UN7vMp5A== X-Received: by 2002:a81:5456:0:b0:55a:5ce4:aff2 with SMTP id i83-20020a815456000000b0055a5ce4aff2mr37130285ywb.39.1684324040350; Wed, 17 May 2023 04:47:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6w3rljo61TGCGB1cPg4w0G8qwwIv3Vl9pAXYHBX3yEvPLcsH3rHLOafV7/hPc1pP+1yN+Qr+uLLCdCO0D1szM= X-Received: by 2002:a81:5456:0:b0:55a:5ce4:aff2 with SMTP id i83-20020a815456000000b0055a5ce4aff2mr37130272ywb.39.1684324040125; Wed, 17 May 2023 04:47:20 -0700 (PDT) In-Reply-To: <83o7mjxk3i.fsf@gnu.org> 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:261842 Archived-At: --000000000000194be605fbe2402d Content-Type: text/plain; charset="UTF-8" On Wed, May 17, 2023, 07:39 Eli Zaretskii wrote: > > From: Spencer Baugh > > Cc: Dmitry Gutov , 63470@debbugs.gnu.org > > Date: Tue, 16 May 2023 16:39:49 -0400 > > > > Eli Zaretskii writes: > > > > >> Date: Fri, 12 May 2023 23:10:05 +0300 > > >> Cc: 63470@debbugs.gnu.org > > >> From: Dmitry Gutov > > >> > > >> On 12/05/2023 22:57, Spencer Baugh wrote: > > >> > > > >> > I could add a user option to revert to the old behavior, if you > want. > > >> > > >> We could cache it like we do with vc-git--program-version. That's a > > >> simple memoization that doesn't take the host into account (though > that > > >> could be implemented, too). > > > > > > Yes, that'd be a good-enough solution. > > > > > >> But it'd really make things easier if we're just allowed to rely on > some > > >> new enough versions of Git and Hg. > > > > > > It isn't easy to be backward-compatible, but we should strive at doing > > > that. > > > > OK, revised backwards-compatible patch attached. > > Thanks, but I'd prefer to call the new function only once, and record > the result in some variable. We do such things in umpteen other > places, so it looks strange to test the version each time only in this > case. > Isn't that what I'm doing? I record the version in a variable and only compute it once. Also, the way I'm doing it exactly matches how vc-git does it. Do you mean a variable that controls whether to use the new argument method? Should the result be computed at load time or at first use of the variable? > > If you are afraid that somehow the version could change while the > Emacs session runs, we could add a command to recompute the version. > I think it's reasonable to ask the user to do this by hand, since > installing a new version of Mercurial should be something users are > aware of. > --000000000000194be605fbe2402d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, May 17, 2023, 07:39 Eli Zaretskii <eliz@gnu.org> wrote:
> From: Spencer Baugh <sbaugh@janestreet.com>
> Cc: Dmitry Gutov <dmitry@gutov.dev>,=C2=A0 63470@debbugs.gn= u.org
> Date: Tue, 16 May 2023 16:39:49 -0400
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> Date: Fri, 12 May 2023 23:10:05 +0300
> >> Cc: 63470@debbugs.gnu.org
> >> From: Dmitry Gutov <dmitry@gutov.dev>
> >>
> >> On 12/05/2023 22:57, Spencer Baugh wrote:
> >> >
> >> > I could add a user option to revert to the old behavior,= if you want.
> >>
> >> We could cache it like we do with vc-git--program-version. Th= at's a
> >> simple memoization that doesn't take the host into accoun= t (though that
> >> could be implemented, too).
> >
> > Yes, that'd be a good-enough solution.
> >
> >> But it'd really make things easier if we're just allo= wed to rely on some
> >> new enough versions of Git and Hg.
> >
> > It isn't easy to be backward-compatible, but we should strive= at doing
> > that.
>
> OK, revised backwards-compatible patch attached.

Thanks, but I'd prefer to call the new function only once, and record the result in some variable.=C2=A0 We do such things in umpteen other
places, so it looks strange to test the version each time only in this
case.

Isn't that what I'm doing? I record the version in a variable = and only compute it once.

Also, the way I'm doing it exactly matches how vc-git does it.
<= div dir=3D"auto">
Do you mean a variable that co= ntrols whether to use the new argument method? Should the result be compute= d at load time or at first use of the variable?

If you are afraid that somehow the version could change while the
Emacs session runs, we could add a command to recompute the version.
I think it's reasonable to ask the user to do this by hand, since
installing a new version of Mercurial should be something users are
aware of.
--000000000000194be605fbe2402d--