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: Thu, 10 Oct 2024 02:36:54 +0300 Message-ID: <2e74a175-50cb-49c9-89b3-cdf09482d66d@gutov.dev> References: <864j6jjzzn.fsf@gnu.org> <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> <12a817d4-ca57-4951-b958-ed4eed96c521@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="33077"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Eli Zaretskii , 73232-done@debbugs.gnu.org, juri@linkov.net To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 10 01:38:10 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 1sygFt-0008Rq-2R for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Oct 2024 01:38:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sygFe-0001RS-2J; Wed, 09 Oct 2024 19:37:54 -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 1sygFc-0001Qo-FE for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 19:37:52 -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 1sygFc-00054e-6g for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 19:37:52 -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:From:References:MIME-Version:Date:To:Subject; bh=6XsNZRnEGkMnsS2Q1LxbzVy+T3HJu3UIMgY6vWhrQ7Q=; b=rKbZbD3h1mlVinrFt3cMHN5la78jkoDVhDSKog/Muu5Tcyj1w2jHHZc8iaaHa1yyUKedjsGKlE/fYRBQVVq8VdgMS+7Hv4G1bi4hEijCW9FaC/S4fQT9HOILxXcwtaNgJ51HsaM1vqsDfDMkiWtE6SP/lJG2bpq5n6hxYZA2rZyiWVEuUqH4krQs0BAb/8rM3ZHjHGVxLaR14M4RDi64heac/idI/HRGDi7dd1Xgopw3K5m1MZ3xdexR0ZYlAALstbGB8v/3C0HIgw1UkCuCtISYvCQMQlaxPHfIQvOQprLZ3nNmKSGs3GkH4sToftQpGyzD8Rwxv9E1OyBeZX9XMw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sygFm-0007q7-4V for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 19:38:02 -0400 Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Oct 2024 23:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 73232 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 73232@debbugs.gnu.org, dmitry@gutov.dev, sbaugh@janestreet.com Original-Received: via spool by 73232-done@debbugs.gnu.org id=D73232.172851703929942 (code D ref 73232); Wed, 09 Oct 2024 23:38:01 +0000 Original-Received: (at 73232-done) by debbugs.gnu.org; 9 Oct 2024 23:37:19 +0000 Original-Received: from localhost ([127.0.0.1]:57956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sygF4-0007mq-UO for submit@debbugs.gnu.org; Wed, 09 Oct 2024 19:37:19 -0400 Original-Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]:38647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sygF0-0007m0-FI for 73232-done@debbugs.gnu.org; Wed, 09 Oct 2024 19:37:16 -0400 Original-Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3F63E1140166; Wed, 9 Oct 2024 19:36:58 -0400 (EDT) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Wed, 09 Oct 2024 19:36: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=1728517018; x=1728603418; bh=6XsNZRnEGkMnsS2Q1LxbzVy+T3HJu3UIMgY6vWhrQ7Q=; b= ddjUls45/fpWuM1NRDsk7zaevCT3JlXTYjLpm9+Kb6N+YMlrlQWYNePv51tTXtdM Axjl8xwoo7J/BG2nC9dOqK6Q0OkgraWKawT7MyqOHdI9K18uHHm4/jOI47Fp0t+N mKfIBCzgeW44wYDyC2IBHIdsdHuUmr6yfQJl02YQc8dpvKdMjhx5pUpslgfuiMHN PmP9Bu+OK9PF68SiQqrNmN3GB6FJDRUOPBo5cmOHTDyIHnmfXxVaFUImIdY1snFU UAUgg7IdoubOYgnn4luABwcpkF4uONgXsf6SUXqvQPCWCZWbgb+oYPx1M5zNBxDg TzAew4qBbtKXcF2MvfOaWQ== 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=1728517018; x= 1728603418; bh=6XsNZRnEGkMnsS2Q1LxbzVy+T3HJu3UIMgY6vWhrQ7Q=; b=o mdL9lDSSsf6mTe3JBKVUKWhyQipwCYRPrB22YUzTWOAus1L+MN9XR9WPOD1EAH7p DplC5p+EE9GDmLawN5RSk+hFAXqoNX6ey4ty4Tp7N+Ro+Yy13JJn/ZasPupGk9T1 cLZ/e+a74LJhV+iO5t/eTUA5oyFnET249H+eaKZzwdmM0jix3+555Ahp2vJGhq+K GGA47oIM1ZXCA9f3Y4Tp24Dm0FqDnOCAtBs3eyFLVOnp10+lStIUlCwlW8jpF/M8 5OY0iKffN9eMJZDUOVMmrP6bqZUQRsTK8mlh22YXP6iTjm+T1Kew6M146oQMTD3R Nrq/SN6Og/KqNj3tY97WA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdefgedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepffeifedvleeukedtgfelieegudfgveekfeejveej ffetffeuueeugefhveeiuddvnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhht ohhvrdguvghvpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtph htthhopehssggruhhghhesjhgrnhgvshhtrhgvvghtrdgtohhmpdhrtghpthhtohepvghl ihiisehgnhhurdhorhhgpdhrtghpthhtohepjeefvdefvddqughonhgvseguvggssghugh hsrdhgnhhurdhorhhgpdhrtghpthhtohepjhhurhhisehlihhnkhhovhdrnhgvth X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Oct 2024 19:36:56 -0400 (EDT) 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:293230 Archived-At: On 04/10/2024 14:38, Spencer Baugh wrote: >>> 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? > This seems reasonable to me. Then we have the following reliable > behaviors: > > - [some diff command] RET > diffs the working tree against HEAD > - C-u [some diff command] RET RET > diffs the working tree against HEAD^ > - C-u [some diff command] M-n RET RET > diffs the working tree against @{upstream} > > This seems like a big improvement, since previously would need to > actually read the prompt in the C-u case to figure out whether the > default was correct/what you wanted. Yep, I think predictability is key. Since there seem to be no objections, I've pushed the proposed change to master (just step number 2, the 3rd one is in another bug#). If anybody's having problems as a result, feedback welcome.