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#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir Date: Sat, 28 Sep 2024 00:49:53 +0300 Message-ID: References: <864j6jjzzn.fsf@gnu.org> <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> 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="36197"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 73232@debbugs.gnu.org, juri@linkov.net To: Spencer Baugh , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 27 23:50:56 2024 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 1suIrX-0009Gl-GT for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Sep 2024 23:50:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suIrG-00075f-D2; Fri, 27 Sep 2024 17:50:38 -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 1suIrC-0006pn-58 for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 17:50:35 -0400 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 1suIrB-0004TH-Qm for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 17:50:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:References:From:MIME-Version:Date:To:Subject; bh=i+ZTgmPyESEnRYbp/ENrMYDQKe2mSNBBr5uqxxJDcSI=; b=EA4BjioQfeEv+6nVN3xNlZgoyy3eB1kd0y/Wg+8Vz0gjml7vzDvfWiO8xNalqZjgKTg95GgRDoFRxT/PlHi1nd27C9RYE2t2LkNl1l0p06X8xkraU1jWoVFV3/tgkSRjf7acPDXxDV+HOWppce6dHx+XH2elkxIAcRNrfHR2f3deHp8MnZUkJmFHX0cVFUbwgLFwO5nU3+OgsAJ++pejIUv4A+08OzdM9lf+GkKpTPCdtwY0TGZ0bbUTouG6j3s4EhKWPm2OtFzueAXF4VrQ0DnpNBU1rcs4p84A/FYb9aNCUsbD1fu+d02uHLJlln1Bc7Zhout6ND0bpEE99Q2Xeg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1suIre-0004vB-Iu for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 17:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Sep 2024 21:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73232 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73232-submit@debbugs.gnu.org id=B73232.172747383518573 (code B ref 73232); Fri, 27 Sep 2024 21:51:02 +0000 Original-Received: (at 73232) by debbugs.gnu.org; 27 Sep 2024 21:50:35 +0000 Original-Received: from localhost ([127.0.0.1]:58023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suIrD-0004pV-8Y for submit@debbugs.gnu.org; Fri, 27 Sep 2024 17:50:35 -0400 Original-Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]:34411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suIrB-0004mG-Jj for 73232@debbugs.gnu.org; Fri, 27 Sep 2024 17:50:34 -0400 Original-Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 7CBEF13801CE; Fri, 27 Sep 2024 17:49:58 -0400 (EDT) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Fri, 27 Sep 2024 17:49:58 -0400 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=fm1; t=1727473798; x=1727560198; bh=i+ZTgmPyESEnRYbp/ENrMYDQKe2mSNBBr5uqxxJDcSI=; b= KGT+7qYp5SVEG6FnL72Ow4RY6tnp5c9y8pyTx5XbWAdJ+LVqcUWb4n7EEdkuDMwy 2k+t1P6YvF/HjmNlJAPi+KNAtE3za6pAYA1jS7EMrN0Zt52ZBACayBQY1vwwGqqj LL+Xr9OAnNIXi/lSbSL19ApeuDO37Z2k7VHDghib3IWKdNhjVZYK/f5slYT3y9bs 9LIfS72d6Z2A0+lFqNmB/1GP5+aFN+F2M0jwgTSothT+oDMC92ftGvLg2gjr190w g9mv2dEx3hIHU+W7M5Z9XUTY0ZB4qJJ8eC99qjNR3agMLWRpNi4r9plOWLhTmkyD VRNRLCP7swQErzPiKLTJKA== 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=fm2; t=1727473798; x= 1727560198; bh=i+ZTgmPyESEnRYbp/ENrMYDQKe2mSNBBr5uqxxJDcSI=; b=N 5edDnzQECQ3454n0pgycy/SgYIe1XZZypCCp+T39JRE7EFdA8dLKKxxIzExrCvWl QBXBQgclUAq7rpZXTAC26L7Ib68cz2N46r4WRND8wzXuIaWJGQ8d3VQkKlkApcX6 CjK3aMaYEPQXmBZ/A5MST5YVu6XH3GQJqYYQ9rXVy70+OVD1lWy+hJQDQUi0TueS 2qPT1Vv96zkw+c7b4kcU17q8imySLvkCWv71YbvRP7jrctuToHH0L0JQISJiISEl uW6RsNgKskIAyCx8pBPI8v2fxKMTqgzm2dHsFF+A3Ne8iXFQKe3iPi1zirf63H8+ FMvblhB752Y7LUAV29f9Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddutddgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffhvfevfhgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepieeftddtieejjeegieejtdefgeejfeetteelheel tdeugeffiefgfedvveevveefnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhht ohhvrdguvghvpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtph htthhopehssggruhhghhesjhgrnhgvshhtrhgvvghtrdgtohhmpdhrtghpthhtohepvghl ihiisehgnhhurdhorhhgpdhrtghpthhtohepjeefvdefvdesuggvsggsuhhgshdrghhnuh drohhrghdprhgtphhtthhopehjuhhriheslhhinhhkohhvrdhnvght X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Sep 2024 17:49:55 -0400 (EDT) Content-Language: en-US In-Reply-To: <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> 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:292538 Archived-At: Hi all, On 14/09/2024 04:45, Dmitry Gutov wrote: > > I can see where you're coming from though -- that default isn't very > useful, one might as well not press C-u. > > Maybe we should switch to suggesting the previous revision in the prompt > even when file has changes? Here's what seems to me an overall improvement, based on the original change. And more consistent as well. * No special case for when FIRST is a directory OR it's not up-to-date. * Make REV1-DEFAULT a list value. * In 'vc-root-version-diff', don't try calling 'vc-deduce-fileset' and construct a (BACKEND DEFAULT-DIR) fileset right away. As a result, 'C-u C-x v d' consistently provides completion and diff relating to the whole repository, not for files as point (if any). Previously, it used the revision that last touched the corresponding file, or nil, if the file was untracked (e.g. in Dired). Further, don't offer the working revision as REV1-DEFAULT. Except for historical reasons and some idea of consistency, I can't see a scenario where that would be useful, which would not be covered by calling 'C-x v d' without a prefix. Someone please correct me here. And combined with Spencer's patch from https://debbugs.gnu.org/62940#46, we get this: * First default is HEAD^ (the last revision before the latest). * Second default is @{upstream}. * Then the elements from vc-revision-history. WDYT?