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:55:23 +0300 Message-ID: <12a817d4-ca57-4951-b958-ed4eed96c521@gutov.dev> References: <864j6jjzzn.fsf@gnu.org> <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------N2bCUcHdi4AXBW80XdY24yHR" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17567"; 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:56: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 1suIxL-0004No-Q6 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Sep 2024 23:56:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suIx1-0008DU-PE; Fri, 27 Sep 2024 17:56:35 -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 1suIx0-000887-Fr for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 17:56:34 -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 1suIx0-00055x-6k for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 17:56:34 -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=9Fv+jQ1oqnG9G2gPLVuiMMwG8P2KWyjl6CXOtsURF8k=; b=BHmtjbf7WsiCPn6Tv4W9Jiotw78YdbMHkixiLHJVojfl1Xyfyeb/Hs1tsXXqUXGRtBeZ/M1+QmPimGaxMzdVwYEjvbZmpM5cxpgvZ8cYD1E6whQs/HhfVOyM6d/lmPPrXBF2CFhxWY2qmFp/tpl3MYj+n1U1GVPWbH0BsV7zXEFPfuEDmD2UbQkq5ictAzA4bMM089apoT3P65ybKyy32hRRwyDcH1j+fYs9t95YV7rj6b2yfA0sJrU6G7BAvTiLEnW8F3dD29gI8wtq4c2Ul0843ctjtddy3xfbMGHcWDM4YGa++0sagAn+ky9PPVIyh4+d0SBnMmssAkEthH4D6g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1suIxT-0005E6-6C for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 17:57:03 -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:57:03 +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.172747416419987 (code B ref 73232); Fri, 27 Sep 2024 21:57:03 +0000 Original-Received: (at 73232) by debbugs.gnu.org; 27 Sep 2024 21:56:04 +0000 Original-Received: from localhost ([127.0.0.1]:58043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suIwV-0005CH-Ro for submit@debbugs.gnu.org; Fri, 27 Sep 2024 17:56:04 -0400 Original-Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]:48981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suIwU-0005Bk-B5 for 73232@debbugs.gnu.org; Fri, 27 Sep 2024 17:56:02 -0400 Original-Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfout.phl.internal (Postfix) with ESMTP id 1808F138020B; Fri, 27 Sep 2024 17:55:28 -0400 (EDT) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Fri, 27 Sep 2024 17:55:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc: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=1727474128; x=1727560528; bh=9Fv+jQ1oqn G9G2gPLVuiMMwG8P2KWyjl6CXOtsURF8k=; b=SMZ2Y3zoQALzMRRaXkT0F9G04G wS6C5OzM3MMU0XTe1WABbmhDKKuRspei12OohTidSPTHmAErsXLxr/0G2aTntsCp b5XzVUAvwblMqtfsyOuxu+HFYZdI+ujJ5z9ZrhCB2ILXqYz+XgpmLKCifEkHYIN7 N/P05MGVeQpgEal8xXH3spYm83C6VfHNtJxZviMS4PjAMtv6Nj0rqbF1UTAqFx3n SGynMKnrO96lOjgvJimyqFfmmY9wnLL6xIfpLI2st6gPuIYhZUy/dzdbApaohi6o h7Q50FK+6gevQU69UPpIXvjGUJVo70p69cnT5ciYg+VHssJVMkb3qhO6UIcg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1727474128; x=1727560528; bh=9Fv+jQ1oqnG9G2gPLVuiMMwG8P2K Wyjl6CXOtsURF8k=; b=Sn45qi9uLSbUKZrPMHwkl7NZY580g2jSxiTsMKAQh/Xk 3mnA2DImcBvzGTO3Sxaswwbuv5nz/9AJ5dzvwXzB+wYmihExpOfc7hSsfHgYMsWX NPFF57FlJc93r0ehot+6xCNaXNzFioeFbW1EKIQ0KILhITfJyET3ZCXILJqqJmz6 p0jJp0Ryjz11Ji/0jUC2DHiLGU5yll/NpZtUSzpV3GZ5DL8Pjq8+axbGsx0AR85R w5wabwiza5JXcLlCxbr4xcv9/4Ooq6EzNwVuqnnireoQcrpOeRTWsFzh5eFviNcR os6AP8NCi3p9Vlmbj1VbKUACe4WELoV7G0zUdm7Hrg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddutddgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurheptgfkffggfgfuhffvvehfjgesmhdtreertddvjeen ucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvg hvqeenucggtffrrghtthgvrhhnpeetieejkeevgfffkeefveettedvteeutdffgefgjeei heejvdetffdvvddthfeigeenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthho vhdruggvvhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htohepshgsrghughhhsehjrghnvghsthhrvggvthdrtghomhdprhgtphhtthhopegvlhhi iiesghhnuhdrohhrghdprhgtphhtthhopeejfedvfedvseguvggssghughhsrdhgnhhurd horhhgpdhrtghpthhtohepjhhurhhisehlihhnkhhovhdrnhgvth X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Sep 2024 17:55:26 -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:292539 Archived-At: This is a multi-part message in MIME format. --------------N2bCUcHdi4AXBW80XdY24yHR Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit And here's the diff. On 28/09/2024 00:49, Dmitry Gutov wrote: > 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? --------------N2bCUcHdi4AXBW80XdY24yHR Content-Type: text/x-patch; charset=UTF-8; name="vc-diff-build-argument-list-internal-for-root.diff" Content-Disposition: attachment; filename="vc-diff-build-argument-list-internal-for-root.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvdmMvdmMuZWwgYi9saXNwL3ZjL3ZjLmVsCmluZGV4IDU5N2Ex NjIyZjVhLi44ZjMyMDBjMWEzOSAxMDA2NDQKLS0tIGEvbGlzcC92Yy92Yy5lbAorKysgYi9s aXNwL3ZjL3ZjLmVsCkBAIC0yMDc0LDIwICsyMDc0LDE1IEBAIHZjLWRpZmYtYnVpbGQtYXJn dW1lbnQtbGlzdC1pbnRlcm5hbAogICAgICA7OyBmaWxlc2V0cywgYnV0IG5vdCB5ZXQuCiAg ICAgICgoLz0gKGxlbmd0aCBmaWxlcykgMSkKICAgICAgIG5pbCkKLSAgICAgOzsgaWYgaXQn cyBhIGRpcmVjdG9yeSwgZG9uJ3Qgc3VwcGx5IGFueSByZXZpc2lvbiBkZWZhdWx0Ci0gICAg ICgoZmlsZS1kaXJlY3RvcnktcCBmaXJzdCkKLSAgICAgIG5pbCkKLSAgICAgOzsgaWYgdGhl IGZpbGUgaXMgbm90IHVwLXRvLWRhdGUsIHVzZSB3b3JraW5nIHJldmlzaW9uIGFzIG9sZGVy IHJldmlzaW9uCi0gICAgICgobm90ICh2Yy11cC10by1kYXRlLXAgZmlyc3QpKQotICAgICAg KHNldHEgcmV2MS1kZWZhdWx0ICh2Yy13b3JraW5nLXJldmlzaW9uIGZpcnN0KSkpCiAgICAg IDs7IGlmIHRoZSBmaWxlIGlzIG5vdCBsb2NrZWQsIHVzZSBsYXN0IHJldmlzaW9uIGFuZCBj dXJyZW50IHNvdXJjZSBhcyBkZWZhdWx0cwogICAgICAodAotICAgICAgKHNldHEgcmV2MS1k ZWZhdWx0IChpZ25vcmUtZXJyb3JzIDtJZiBgcHJldmlvdXMtcmV2aXNpb24nIGRvZXNuJ3Qg d29yay4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICh2Yy1jYWxsLWJhY2tlbmQgYmFj a2VuZCAncHJldmlvdXMtcmV2aXNpb24gZmlyc3QKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKHZjLXdvcmtpbmctcmV2aXNpb24gZmlyc3QpKSkpCi0g ICAgICAod2hlbiAoc3RyaW5nPSByZXYxLWRlZmF1bHQgIiIpIChzZXRxIHJldjEtZGVmYXVs dCBuaWwpKSkpCisgICAgICAocHVzaCAoaWdub3JlLWVycm9ycyAgICAgICAgIDtJZiBgcHJl dmlvdXMtcmV2aXNpb24nIGRvZXNuJ3Qgd29yay4KKyAgICAgICAgICAgICAgKHZjLWNhbGwt YmFja2VuZCBiYWNrZW5kICdwcmV2aW91cy1yZXZpc2lvbiBmaXJzdAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICh2Yy13b3JraW5nLXJldmlzaW9uIGZpcnN0IGJhY2tlbmQp KSkKKyAgICAgICAgICAgIHJldjEtZGVmYXVsdCkKKyAgICAgICh3aGVuIChtZW1iZXIgKGNh ciByZXYxLWRlZmF1bHQpICcoIiIgbmlsKSkgKHNldHEgcmV2MS1kZWZhdWx0IG5pbCkpKSkK ICAgICA7OyBjb25zdHJ1Y3QgYXJndW1lbnQgbGlzdAotICAgIChsZXQqICgocmV2MS1wcm9t cHQgKGZvcm1hdC1wcm9tcHQgIk9sZGVyIHJldmlzaW9uIiByZXYxLWRlZmF1bHQpKQorICAg IChsZXQqICgocmV2MS1wcm9tcHQgKGZvcm1hdC1wcm9tcHQgIk9sZGVyIHJldmlzaW9uIiAo Y2FyIHJldjEtZGVmYXVsdCkpKQogICAgICAgICAgICAocmV2Mi1wcm9tcHQgKGZvcm1hdC1w cm9tcHQgIk5ld2VyIHJldmlzaW9uIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOzsgKG9yIHJldj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