From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 13 11:52:06 2024 Received: (at submit) by debbugs.gnu.org; 13 Sep 2024 15:52:06 +0000 Received: from localhost ([127.0.0.1]:44094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp8ab-0007SV-Hl for submit@debbugs.gnu.org; Fri, 13 Sep 2024 11:52:06 -0400 Received: from lists.gnu.org ([209.51.188.17]:58884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp8aY-0007S5-Q7 for submit@debbugs.gnu.org; Fri, 13 Sep 2024 11:52:03 -0400 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 1sp8aO-0005Mq-On for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2024 11:51:52 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sp8aL-0003gQ-Mt for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2024 11:51:52 -0400 From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: [PATCH] Allow vc-diff to suggest a default revision in vc-dir Date: Fri, 13 Sep 2024 11:51:47 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1726242707; bh=u5v69PST72OOA+gpV+IQcxKhmGCb8oPCNJoj4G0CXUE=; h=From:To:Cc:Subject:Date; b=GQv+oniSZ7BiRjUuoW6aUlz2KBTuFFvL/yNm/9w0sjjHGvsBzmBHE09Lps4j6Iu1n oi7fea6ogdB1qogR1cBddVX7PDq1S5fFMUpUMWDBKEiQtVIhzAAlwLtrbWrdBi/4Nr ad7UetXvOaFXWD4RAB8T0XHlPdLjfxcbaO6BoPVOCI2amPniEogJRN9ZQoZI2JtMg+ Sk/eq/rneZN9lT+W4DjQruWtDeyTjNx6EsV4x3lrBIaamB9+3YLFmeYbQAFn9vuGbj rz/khMxFlKhL6V98zN+5N3HI2xIEqOzI40QktRfQ26ZYSARjYjgsiy22SG5ogWzW6D z3EejQUcRxh8Q== Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch C-u M-x vc-root-diff will prompt for the old revision to use for the diff. The prompt will have a default calculated by vc-diff-build-argument-list-internal. The default is either the working revision of the current fileset or the revision before that. vc-diff-build-argument-list-internal contained a check (added in c0d66cb21bac57f5ec0378e8a04aac8f35c3eb5c) which explicitly avoided setting a default if the current fileset was a directory. This check was added in 1997 when vc only worked for single files. This prevents a backend from choosing to return a non-nil value from 'working-revision when passed a directory. (The vc-hg and vc-git backends, at least, will do this) Allow this by moving the file-directory-p check, so that we try calling 'working-revision when the fileset is a single directory. The call is in inside ignore-errors, so if a backend errors when passed a directory, we'll just get no default, as before. (Most backends will just return nil for a directory, rather than erroring) Also, while we're here, explicitly pass the backend to vc-working-revision rather than having vc-working-revision recompute it. Concretely this has the effect that for the vc-git and vc-hg backends, running C-u M-x vc-root-diff in vc-dir will have the same behavior as running C-u M-x vc-root-diff in a clean file: The "Previous revision:" prompt's default will be the revision before HEAD. * lisp/vc/vc.el (vc-diff-build-argument-list-internal): Move file-directory-p check. In GNU Emacs 29.2.50 (build 17, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2024-09-06 built on igm-qws-u22796a Repository revision: e6d04c06a7eb6ce932b52a346368d02b7a811a00 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.10 (Green Obsidian) Configured using: 'configure --with-x-toolkit=lucid --without-gpm --without-gconf --without-selinux --without-imagemagick --with-modules --with-gif=no --with-cairo --with-rsvg --without-compress-install --with-native-compilation=aot --with-tree-sitter PKG_CONFIG_PATH=/usr/local/home/garnish/libtree-sitter/0.22.6-1/lib/pkgconfig/' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Allow-vc-diff-to-suggest-a-default-revision-in-vc-di.patch >From e57db4d91cf098d26c8c131d715ef3619466d159 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Fri, 13 Sep 2024 11:34:55 -0400 Subject: [PATCH] Allow vc-diff to suggest a default revision in vc-dir C-u M-x vc-root-diff will prompt for the old revision to use for the diff. The prompt will have a default calculated by vc-diff-build-argument-list-internal. The default is either the working revision of the current fileset or the revision before that. vc-diff-build-argument-list-internal contained a check (added in c0d66cb21bac57f5ec0378e8a04aac8f35c3eb5c) which explicitly avoided setting a default if the current fileset was a single directory. This check was added in 1997 when vc only worked for single files. This prevents a backend from choosing to return a non-nil value from 'working-revision when passed a directory. (The vc-hg and vc-git backends, at least, will do this) Allow this by moving the file-directory-p check, so that we try calling 'working-revision when the fileset is a single directory. The call is in inside ignore-errors, so if a backend errors when passed a directory, we'll just get no default, as before. (Most backends will just return nil for a directory, rather than erroring) Also, while we're here, explicitly pass the backend to vc-working-revision rather than having vc-working-revision recompute it. Concretely this has the effect that for the vc-git and vc-hg backends, running C-u M-x vc-root-diff in vc-dir will have the same behavior as running C-u M-x vc-root-diff in a clean file: The "Previous revision:" prompt's default will be the revision before HEAD. * lisp/vc/vc.el (vc-diff-build-argument-list-internal): Move file-directory-p check. --- lisp/vc/vc.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 597a1622f5a..d88a655dc6b 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2074,17 +2074,14 @@ vc-diff-build-argument-list-internal ;; filesets, but not yet. ((/= (length files) 1) nil) - ;; if it's a directory, don't supply any revision default - ((file-directory-p first) - nil) ;; if the file is not up-to-date, use working revision as older revision - ((not (vc-up-to-date-p first)) - (setq rev1-default (vc-working-revision first))) + ((not (and (file-directory-p first) (vc-up-to-date-p first))) + (setq rev1-default (vc-working-revision first backend))) ;; if the file is not locked, use last revision and current source as defaults (t (setq rev1-default (ignore-errors ;If `previous-revision' doesn't work. (vc-call-backend backend 'previous-revision first - (vc-working-revision first)))) + (vc-working-revision first backend)))) (when (string= rev1-default "") (setq rev1-default nil)))) ;; construct argument list (let* ((rev1-prompt (format-prompt "Older revision" rev1-default)) -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 13 12:11:30 2024 Received: (at 73232) by debbugs.gnu.org; 13 Sep 2024 16:11:30 +0000 Received: from localhost ([127.0.0.1]:44144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp8tN-0000Jv-OA for submit@debbugs.gnu.org; Fri, 13 Sep 2024 12:11:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp8tM-0000JX-2X for 73232@debbugs.gnu.org; Fri, 13 Sep 2024 12:11:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sp8t5-00060t-6r; Fri, 13 Sep 2024 12:11:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MYYXB5GWUCJDkeZCbBVzqKQJtt8fiwbPo9DQziDyF6s=; b=DG7rUtyyiGrp jZJHl+UlH4eNgb7XZLURgjonRcB4WAKEeGiFYTE0WZWUcsfHELu98IqTYmHlB+QcTSg4XS3Cpchh7 3QJ8Gpc1YE4qhBTwBEFsM20GhwhrfhewH5cmHCyJ/CBvj0L1Eahpf69zgC5ezgFEcdp9B8w1m/23V ex145kKYnBQo06mS+ifShyAZhdZeix6RKhChcnxUBFfiWRUWVvKVkWEzzSHiNqmAI150aoOU8fkpS aqUO0F0aKhWk0/S2fxfa8H9RLXGC88798P5jIuSyvWC/NjAm8xBgkOB9EyEt7F7Sop8SWCRBEtHgR TBORL/XNCvVG1WHycKxFQg==; Date: Fri, 13 Sep 2024 19:10:52 +0300 Message-Id: <864j6jjzzn.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73232 Cc: 73232@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Juri Linkov > Date: Fri, 13 Sep 2024 11:51:47 -0400 > From: Spencer Baugh via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > - ;; if it's a directory, don't supply any revision default > - ((file-directory-p first) > - nil) > ;; if the file is not up-to-date, use working revision as older revision > - ((not (vc-up-to-date-p first)) > - (setq rev1-default (vc-working-revision first))) > + ((not (and (file-directory-p first) (vc-up-to-date-p first))) > + (setq rev1-default (vc-working-revision first backend))) Doesn't this change the conditions under which we use vc-working-revision for regular files? Did you perhaps mean ((and (not (file-directory-p first)) (vc-up-to-date-p first)) instead? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 13 12:25:28 2024 Received: (at 73232) by debbugs.gnu.org; 13 Sep 2024 16:25:28 +0000 Received: from localhost ([127.0.0.1]:44160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp96u-0001FS-0z for submit@debbugs.gnu.org; Fri, 13 Sep 2024 12:25:28 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:38027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp96s-0001F9-1o for 73232@debbugs.gnu.org; Fri, 13 Sep 2024 12:25:26 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir In-Reply-To: <864j6jjzzn.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 Sep 2024 19:10:52 +0300") References: <864j6jjzzn.fsf@gnu.org> Date: Fri, 13 Sep 2024 12:25:10 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1726244711; bh=PCr27WKu5H4rTyVPHa+hCG6B7CrC3hRMKwKZxwvfpm8=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=cNNApFNgQ55XZ+r9Gjt/y19crDMPoLT2M0dIbmdkBsMcnEkfpREpcb1ZPHH4aOA0z QVeB0sGW2yAcdCyMh/6MgAdjGra7W5ce7qZ43LYJYNBWbEh3jAnkrTOLiGzz3kRKsg iWceYjg/qcMg8YeXs1nG3kZf1xc53NxPaMyKaUz1SH4iEf6S/AXaERgW4g8Cv7Ei9H 7Jhu+1Gus2AFGNgvZNpVe4ZtLayCyMARGJ8wNH0EuCxmK5YuVd/5/5pK3Q5OtEm5B2 cYxDxKl8eJ1MCXfe8uDbe1I+8H+ekNHRD+2iB8v4Umh53GeLaLdz5Lvqa+GVSQ7d+T aGQED579mZNhQ== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 73232 Cc: 73232@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> Cc: Juri Linkov >> Date: Fri, 13 Sep 2024 11:51:47 -0400 >> From: Spencer Baugh via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> - ;; if it's a directory, don't supply any revision default >> - ((file-directory-p first) >> - nil) >> ;; if the file is not up-to-date, use working revision as older revision >> - ((not (vc-up-to-date-p first)) >> - (setq rev1-default (vc-working-revision first))) >> + ((not (and (file-directory-p first) (vc-up-to-date-p first))) >> + (setq rev1-default (vc-working-revision first backend))) > > Doesn't this change the conditions under which we use > vc-working-revision for regular files? Did you perhaps mean > > ((and (not (file-directory-p first)) (vc-up-to-date-p first)) > > instead? Oops, yes, fixed. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Allow-vc-diff-to-suggest-a-default-revision-in-vc-di.patch >From f87b92ce5775d0558b7d9dd502687d1f460bcd2a Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Fri, 13 Sep 2024 11:34:55 -0400 Subject: [PATCH] Allow vc-diff to suggest a default revision in vc-dir C-u M-x vc-root-diff will prompt for the old revision to use for the diff. The prompt will have a default calculated by vc-diff-build-argument-list-internal. The default is either the working revision of the current fileset or the revision before that. vc-diff-build-argument-list-internal contained a check (added in c0d66cb21bac57f5ec0378e8a04aac8f35c3eb5c) which explicitly avoided setting a default if the current fileset was a single directory. This check was added in 1997 when vc only worked for single files. This prevents a backend from choosing to return a non-nil value from 'working-revision when passed a directory. (The vc-hg and vc-git backends, at least, will do this) Allow this by moving the file-directory-p check, so that we try calling 'working-revision when the fileset is a single directory. The call is in inside ignore-errors, so if a backend errors when passed a directory, we'll just get no default, as before. (Most backends will just return nil for a directory, rather than erroring) Also, while we're here, explicitly pass the backend to vc-working-revision rather than having vc-working-revision recompute it. Concretely this has the effect that for the vc-git and vc-hg backends, running C-u M-x vc-root-diff in vc-dir will have the same behavior as running C-u M-x vc-root-diff in a clean file: The "Previous revision:" prompt's default will be the revision before HEAD. * lisp/vc/vc.el (vc-diff-build-argument-list-internal): Move file-directory-p check. (bug#73232) --- lisp/vc/vc.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 597a1622f5a..7b1133565f9 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2074,17 +2074,14 @@ vc-diff-build-argument-list-internal ;; filesets, but not yet. ((/= (length files) 1) nil) - ;; if it's a directory, don't supply any revision default - ((file-directory-p first) - nil) ;; if the file is not up-to-date, use working revision as older revision - ((not (vc-up-to-date-p first)) - (setq rev1-default (vc-working-revision first))) + ((and (not (file-directory-p first)) (not (vc-up-to-date-p first))) + (setq rev1-default (vc-working-revision first backend))) ;; if the file is not locked, use last revision and current source as defaults (t (setq rev1-default (ignore-errors ;If `previous-revision' doesn't work. (vc-call-backend backend 'previous-revision first - (vc-working-revision first)))) + (vc-working-revision first backend)))) (when (string= rev1-default "") (setq rev1-default nil)))) ;; construct argument list (let* ((rev1-prompt (format-prompt "Older revision" rev1-default)) -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 13 21:46:02 2024 Received: (at 73232) by debbugs.gnu.org; 14 Sep 2024 01:46:03 +0000 Received: from localhost ([127.0.0.1]:44492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spHrO-0008KM-Cj for submit@debbugs.gnu.org; Fri, 13 Sep 2024 21:46:02 -0400 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]:52705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spHrN-0008Js-4L for 73232@debbugs.gnu.org; Fri, 13 Sep 2024 21:46:01 -0400 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id A061B11400E2; Fri, 13 Sep 2024 21:45:45 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Fri, 13 Sep 2024 21:45:45 -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=fm3; t=1726278345; x=1726364745; bh=mrAZKTgK+90KXJHMSBNf7hrRljXrQhUTzf7iZ7rJ+/c=; b= PcsbhvUjUKO0uPQTVBdWa9KLWN6hvBdGuZsCU3MxC6TbDyh7PUYq6eU9KB2VDT1H DACvuFJ/x1VpegGhcmMzQsvJDpVSKyw0RVVUVsbHL4BnqEvyq0IiGtydlBc4nw72 wBGoZbdftj5EcrPmL1Ojkk7OjPk20nX7DYdZ2KRKeo4NUcNbpOt67Sx6F+RmfGqO WSD6iSezmpwpqCPbg0PUW80xtqzYgrWe5p/UrmFlEpODf2ttZyXBiFqTrVylJEIN VbmFszmAKA3tUDZuCB648jfedDydlTUnipJ/Kg6meUkfShaooF7HL1mPvF/inekJ Mzyj5zw2a5D02jsZ/GnHdQ== 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=fm1; t=1726278345; x= 1726364745; bh=mrAZKTgK+90KXJHMSBNf7hrRljXrQhUTzf7iZ7rJ+/c=; b=f chygwc3OHq/tYALXczK03sGNXMEscKbZNzHehu8XQtDsBLnRIsskEAQkdl5VLT0X gSPNN6lKdLYejdu54hLksDwgquAkr8vBVKFY7DX74T4MBOw8LA/SuEr5dv/eTikB v0lreapLyINL/QlMHnoDWJGZG+2qlg3kJa9g7PYgwFI7qC0gT6a4Mvk7Cmrww4FO w+nGqzacFdbEgt1iA+1C8zZh0c5/GUl3kCa2T4bvJdHs9DyKW9xelSbEDBl4tBmz kVOXJctGyaVaaQpji1IVaX0yCNn9e9PJOwKgVvdRKJG/F+eZNVaT9EDZqnEpS/rw OmnsQlD6faJFoKMcM1N8A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudejledghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieekueef tddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho peegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehssggruhhghhesjhgrnhgvsh htrhgvvghtrdgtohhmpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghpthht ohepjeefvdefvdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehjuhhrih eslhhinhhkohhvrdhnvght X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Sep 2024 21:45:43 -0400 (EDT) Message-ID: <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> Date: Sat, 14 Sep 2024 04:45:42 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir To: Spencer Baugh , Eli Zaretskii References: <864j6jjzzn.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73232 Cc: 73232@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Spencer, On 13/09/2024 19:25, Spencer Baugh via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Concretely this has the effect that for the vc-git and vc-hg backends, > running C-u M-x vc-root-diff in vc-dir will have the same behavior as > running C-u M-x vc-root-diff in a clean file: The "Previous revision:" > prompt's default will be the revision before HEAD. Is this consistent with the current behavior with files? I mean, if there are any uncommitted changes in a file, we suggest the current revision as the one to diff against. But with a directory we can't so easily determine whether are uncommitted changes, but in all likelihood, most of the time when you're working on a new feature, there would be. So statistically speaking, shouldn't we default to the "file with changes" behavior, suggesting the HEAD revision? 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? > * lisp/vc/vc.el (vc-diff-build-argument-list-internal): Move > file-directory-p check. (bug#73232) Maybe this should mention reusing the value of backend too, for completeness. Also I wonder if it's okay to have a multi-paragraph description in the commit message. CONTRIBUTE seems to suggest one paragraph (if any) between the summary and the ChangeLog-style contents, but it doesn't suggest moving any parts of the description to the bug tracker. But IDK, for those who still read the changelog files (instead of using vc-print-root-log) this might be too much for a short change. The detailed description is great, though, so thanks. Eli and others, what do you think? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 03:04:50 2024 Received: (at 73232) by debbugs.gnu.org; 14 Sep 2024 07:04:50 +0000 Received: from localhost ([127.0.0.1]:44596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spMpu-0000yM-9g for submit@debbugs.gnu.org; Sat, 14 Sep 2024 03:04:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spMpr-0000y5-Ug for 73232@debbugs.gnu.org; Sat, 14 Sep 2024 03:04:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spMpb-00060E-5W; Sat, 14 Sep 2024 03:04:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7i4amtXhCN/TT1UwbuIfH0Ta7PJijnOe3QpJq3WRQvw=; b=FdulnLeNfZZG XRaS/UTI2bWNnVE0T0VBAbaTXbIk8vG4r6/vf4oldU98PfR7HXcL5aiNHowL8DY5K9fzjDtBe1w9C fcDXf4BgboCktggY+Eu1TpektdFiqo3aw1pEPdE6azgNOJpQfjijid9YZ0ussFApJxtxR3ME3gn+A duaW29gdLS80//ymloXYb5sBwUqieckR1kiw/tu9LmxYE6hbZvA6FAanTb1EN4rP/1Zv1D+GXUJbY Xqza//9A25eZR+glafmOhjfNCS5f2FziS3F7ZyBhiJpV3dz7WvhTdxhmBUJRzyAGG83nNS2p/FghO wLUT63H0d/JIDLKADoNZMQ==; Date: Sat, 14 Sep 2024 10:04:27 +0300 Message-Id: <86seu2iumc.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> (message from Dmitry Gutov on Sat, 14 Sep 2024 04:45:42 +0300) Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir References: <864j6jjzzn.fsf@gnu.org> <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73232 Cc: sbaugh@janestreet.com, 73232@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 14 Sep 2024 04:45:42 +0300 > Cc: 73232@debbugs.gnu.org, juri@linkov.net > From: Dmitry Gutov > > Hi Spencer, > > On 13/09/2024 19:25, Spencer Baugh via Bug reports for GNU Emacs, the > Swiss army knife of text editors wrote: > > Concretely this has the effect that for the vc-git and vc-hg backends, > > running C-u M-x vc-root-diff in vc-dir will have the same behavior as > > running C-u M-x vc-root-diff in a clean file: The "Previous revision:" > > prompt's default will be the revision before HEAD. > > Is this consistent with the current behavior with files? > > I mean, if there are any uncommitted changes in a file, we suggest the > current revision as the one to diff against. > > But with a directory we can't so easily determine whether are > uncommitted changes, but in all likelihood, most of the time when you're > working on a new feature, there would be. So statistically speaking, > shouldn't we default to the "file with changes" behavior, suggesting the > HEAD revision? > > 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? > > > * lisp/vc/vc.el (vc-diff-build-argument-list-internal): Move > > file-directory-p check. (bug#73232) > > Maybe this should mention reusing the value of backend too, for > completeness. > > Also I wonder if it's okay to have a multi-paragraph description in the > commit message. CONTRIBUTE seems to suggest one paragraph (if any) > between the summary and the ChangeLog-style contents, but it doesn't > suggest moving any parts of the description to the bug tracker. But IDK, > for those who still read the changelog files (instead of using > vc-print-root-log) this might be too much for a short change. The > detailed description is great, though, so thanks. I've modified CONTRIBUTE to not insist on "a paragraph". (This is exactly why I hate to codify stuff that is usually a no-brainer: people tend to interpret each word and letter literally, as if they were in a legally-binding document, and there's no end to complaints and discussions about these unimportant details.) My POV is that the description should be as clear and concise as possible. In most cases, there should be a bug report for the issue, or some on-list discussion of it, and the gory details should be described there, with only a reference left in the log message. And, of course, the important stuff that explains how the code works and why it does something non-trivial should be in comments in the code. IOW, I consider a long and very detailed description in the log message a clear sign that something went wrong in the process: either we didn't have the issue discussed in a place that can be referenced, or the code needs to be cleaned-up or commented, or something else. Git log is NOT the best place to document code changes. > Eli and others, what do you think? If you are asking about this bug report, then frankly I don't understand the use case: when would a user want to invoke this command with point on a directory? Directories are never important items in VC-related activities; files are. When I'm looking at a tree with changes, I'm never interested with directories, only with files. It is not a coincidence that "git status" will never say anything about directories; e.g., if you create a directory, you will not see it in the status, unlike a new file. So I think I'd need to understand better the use case before I make up my mind about this proposal. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 12:14:02 2024 Received: (at 73232) by debbugs.gnu.org; 14 Sep 2024 16:14:02 +0000 Received: from localhost ([127.0.0.1]:47705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spVPO-00085Q-0v for submit@debbugs.gnu.org; Sat, 14 Sep 2024 12:14:02 -0400 Received: from fout2-smtp.messagingengine.com ([103.168.172.145]:38033) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spVPL-00084h-7U for 73232@debbugs.gnu.org; Sat, 14 Sep 2024 12:13:59 -0400 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 5F9DA13801EF; Sat, 14 Sep 2024 12:13:43 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Sat, 14 Sep 2024 12:13:43 -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=fm3; t=1726330423; x=1726416823; bh=64w0rR7FCyUEZvJe42SIQcHYNYyra7HLlbPaYShY9yw=; b= igsV0mL3txNju2qqRvP5OY478sFt8Vx70aGDDEV0YC5sG3E1uqEcD0SK/0FFy01k EPETPz7T5uQNfxw5BW4HzlZcZqbCRZ7zdj3uZAhjQ6wB61iQcDq40Gcn4bGtFrF4 vgJPZI0Y7UZfnvF3n24kjH5rhiYjxQJhBQ/BLlCkdKQGXoxzo64hqhFE60QjkKUA LUqzwi5HnqUZStFBDETip0Dz8aOfY3PiPV70fkyib0/Af+22ipvWD5Lr3fHc4M/h ZlFrk7+iwY3gtTVo5e4EUr+7gGPiyqLA5pTJQLULOKm9Ua4R+NAUeKbF3MxwTOHP T5IUclFdMmYXbidRIbz8Mw== 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=fm1; t=1726330423; x= 1726416823; bh=64w0rR7FCyUEZvJe42SIQcHYNYyra7HLlbPaYShY9yw=; b=p 0ZNW9oAxMa7lI6YouV+ueR1lzT0YsgqMArRy451kM+7ZGRi6CBcUj3NtxJ7z9jfl Djb6K62fja2K4F+wE55IU0smsnyDSyPgSH92Zrf0v+vpsUqSwKtiO+lAZTkcLDQz WNe53mibMrbfbx6WB2WIkO7IL1r2UlxSrhP9G0z9av2h5XjMipOpNeYh8UPtjNxS 4aPYjm5Q8gyPdl3a4sjEHRo4yWyK8GROuxZg6eq93Jyd++r8BLYGZvpFe30pWxKW 9ZumxkbKCCCjKfwrKghHiGKhHz//GNtB+dmr0m3b7JBp4vizqfRNEmHwVuU2ypSr rrg50u4R3Bb8xoMPRHXTQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudektddgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieekueef tddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho peegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrgh dprhgtphhtthhopehssggruhhghhesjhgrnhgvshhtrhgvvghtrdgtohhmpdhrtghpthht ohepjeefvdefvdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehjuhhrih eslhhinhhkohhvrdhnvght X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 14 Sep 2024 12:13:41 -0400 (EDT) Message-ID: Date: Sat, 14 Sep 2024 19:13:40 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir To: Eli Zaretskii References: <864j6jjzzn.fsf@gnu.org> <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> <86seu2iumc.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <86seu2iumc.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73232 Cc: sbaugh@janestreet.com, 73232@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 14/09/2024 10:04, Eli Zaretskii wrote: >> Also I wonder if it's okay to have a multi-paragraph description in the >> commit message. CONTRIBUTE seems to suggest one paragraph (if any) >> between the summary and the ChangeLog-style contents, but it doesn't >> suggest moving any parts of the description to the bug tracker. But IDK, >> for those who still read the changelog files (instead of using >> vc-print-root-log) this might be too much for a short change. The >> detailed description is great, though, so thanks. > > I've modified CONTRIBUTE to not insist on "a paragraph". (This is > exactly why I hate to codify stuff that is usually a no-brainer: > people tend to interpret each word and letter literally, as if they > were in a legally-binding document, and there's no end to complaints > and discussions about these unimportant details.) > > My POV is that the description should be as clear and concise as > possible. In most cases, there should be a bug report for the issue, > or some on-list discussion of it, and the gory details should be > described there, with only a reference left in the log message. And, > of course, the important stuff that explains how the code works and > why it does something non-trivial should be in comments in the code. > > IOW, I consider a long and very detailed description in the log > message a clear sign that something went wrong in the process: either > we didn't have the issue discussed in a place that can be referenced, > or the code needs to be cleaned-up or commented, or something else. > Git log is NOT the best place to document code changes. Thanks. So if I understand this right, we're allowed to have multiple paragraphs in the commit message's description, but we'd rather not. Perhaps we'd opt for this approach more often when there is no existing bug report. >> Eli and others, what do you think? > > If you are asking about this bug report, then frankly I don't > understand the use case: when would a user want to invoke this command > with point on a directory? I was asking primarily about the documentation standard, so it's okay if you don't have a strong position on this. Thanks anyway. > Directories are never important items in > VC-related activities; files are. IME it's pretty common to invoke vc-root-diff from the vc-dir buffer. And we also added the capability to call vc-diff from Dired recently. I don't do this myself often, TBH, but if someone is working in large repo, and the project is split into directories along subsystem lines, then one might want to make commits limited to subdirectories. Then it should be useful to call vc-diff on such a directory first. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 12:50:06 2024 Received: (at 73232) by debbugs.gnu.org; 14 Sep 2024 16:50:06 +0000 Received: from localhost ([127.0.0.1]:47732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spVyH-0001ib-Tc for submit@debbugs.gnu.org; Sat, 14 Sep 2024 12:50:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spVyE-0001hp-6h for 73232@debbugs.gnu.org; Sat, 14 Sep 2024 12:50:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spVxw-0003NP-1M; Sat, 14 Sep 2024 12:49:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=oybIg5QGMaJAJCi56PhLLpZ9rTNyIvXoVqtst9v9rdw=; b=TaH3QLm1nNmt +sy/6r1zLdqcy1EjtDqLQjsS8IQO+8tXQIXSMyXSPjNdlJ5wGRQUSzSHz1DSChCxeMxO2vT6ZuerN r1G+X+2mnwNQNtpEnC6aH9DcSlxSpl5y8OYBRObGXAmLyTNZEIEBRzHm+2xVHba4bganiTXZeLod5 cuOjZSh5Hwb0amCar5x8/JhmdWfeVDmJGnzDTTpOSDyUA1zluFbHRaqu0xn1182PUY3jsPr+4NkZk SRNDCWFPCUwaJXzru9nHNBIhd4sYjJxcIkNA4rSrU5GUXTrPzTHtYfJQlPyQUzIrG7aobrHeDnNAI 2mXeYTBX3EoEasgp6b0MaQ==; Date: Sat, 14 Sep 2024 19:49:41 +0300 Message-Id: <867cbefae2.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: (message from Dmitry Gutov on Sat, 14 Sep 2024 19:13:40 +0300) Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir References: <864j6jjzzn.fsf@gnu.org> <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> <86seu2iumc.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73232 Cc: sbaugh@janestreet.com, 73232@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 14 Sep 2024 19:13:40 +0300 > Cc: sbaugh@janestreet.com, 73232@debbugs.gnu.org, juri@linkov.net > From: Dmitry Gutov > > On 14/09/2024 10:04, Eli Zaretskii wrote: > > > Directories are never important items in > > VC-related activities; files are. > > IME it's pretty common to invoke vc-root-diff from the vc-dir buffer. Yes, but vc-dir shows files. Directories are shown, but when there are files with "unusual" status, they dominate the display. > I don't do this myself often, TBH, but if someone is working in large > repo, and the project is split into directories along subsystem lines, > then one might want to make commits limited to subdirectories. Then it > should be useful to call vc-diff on such a directory first. Does anyone really do such things nowadays? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 17 03:06:27 2024 Received: (at 73232) by debbugs.gnu.org; 17 Sep 2024 07:06:27 +0000 Received: from localhost ([127.0.0.1]:53774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqSI6-00006H-SE for submit@debbugs.gnu.org; Tue, 17 Sep 2024 03:06:27 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:37883) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqSI4-00005y-VL for 73232@debbugs.gnu.org; Tue, 17 Sep 2024 03:06:25 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id CE99EC0002; Tue, 17 Sep 2024 07:05:42 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir In-Reply-To: (Dmitry Gutov's message of "Sat, 14 Sep 2024 19:13:40 +0300") Organization: LINKOV.NET References: <864j6jjzzn.fsf@gnu.org> <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> <86seu2iumc.fsf@gnu.org> Date: Tue, 17 Sep 2024 09:59:06 +0300 Message-ID: <86msk6zrq1.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73232 Cc: sbaugh@janestreet.com, Eli Zaretskii , 73232@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > And we also added the capability to call vc-diff from Dired recently. Most of the time I'm using 'C-u C-x v =' on a file or directory to select another branch as an "Older revision" to compare branches. But no useful default is possible in such use cases. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 27 17:50:35 2024 Received: (at 73232) by debbugs.gnu.org; 27 Sep 2024 21:50:35 +0000 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 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 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) 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 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Sep 2024 17:49:55 -0400 (EDT) Message-ID: Date: Sat, 28 Sep 2024 00:49:53 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir From: Dmitry Gutov To: Spencer Baugh , Eli Zaretskii References: <864j6jjzzn.fsf@gnu.org> <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> Content-Language: en-US In-Reply-To: <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73232 Cc: 73232@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 27 17:56:04 2024 Received: (at 73232) by debbugs.gnu.org; 27 Sep 2024 21:56:04 +0000 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 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 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) 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 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Sep 2024 17:55:26 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------N2bCUcHdi4AXBW80XdY24yHR" Message-ID: <12a817d4-ca57-4951-b958-ed4eed96c521@gutov.dev> Date: Sat, 28 Sep 2024 00:55:23 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir From: Dmitry Gutov To: Spencer Baugh , Eli Zaretskii References: <864j6jjzzn.fsf@gnu.org> <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> Content-Language: en-US In-Reply-To: X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73232 Cc: 73232@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 ICAgICAgICAgOzsgKG9yIHJldjItZGVmYXVsdAogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgImN1cnJlbnQgc291cmNlIikpCkBAIC0yMTE5LDkgKzIxMTQsOCBA QCB2Yy1yb290LXZlcnNpb24tZGlmZgogICAiUmVwb3J0IGRpZmZzIGJldHdlZW4gUkVWMSBh bmQgUkVWMiByZXZpc2lvbnMgb2YgdGhlIHdob2xlIHRyZWUuIgogICAoaW50ZXJhY3RpdmUK ICAgICh2Yy1kaWZmLWJ1aWxkLWFyZ3VtZW50LWxpc3QtaW50ZXJuYWwKLSAgICAob3IgKGln bm9yZS1lcnJvcnMgKHZjLWRlZHVjZS1maWxlc2V0IHQpKQotICAgICAgICAobGV0ICgoYmFj a2VuZCAob3IgKHZjLWRlZHVjZS1iYWNrZW5kKSAodmMtcmVzcG9uc2libGUtYmFja2VuZCBk ZWZhdWx0LWRpcmVjdG9yeSkpKSkKLSAgICAgICAgICAobGlzdCBiYWNrZW5kIChsaXN0ICh2 Yy1jYWxsLWJhY2tlbmQgYmFja2VuZCAncm9vdCBkZWZhdWx0LWRpcmVjdG9yeSkpKSkpKSkK KyAgICAobGV0ICgoYmFja2VuZCAob3IgKHZjLWRlZHVjZS1iYWNrZW5kKSAodmMtcmVzcG9u c2libGUtYmFja2VuZCBkZWZhdWx0LWRpcmVjdG9yeSkpKSkKKyAgICAgIChsaXN0IGJhY2tl bmQgKGxpc3QgKHZjLWNhbGwtYmFja2VuZCBiYWNrZW5kICdyb290IGRlZmF1bHQtZGlyZWN0 b3J5KSkpKSkpCiAgIDs7IFRoaXMgaXMgYSBtaXggb2YgYHZjLXJvb3QtZGlmZicgYW5kIGB2 Yy12ZXJzaW9uLWRpZmYnCiAgICh3aGVuIChhbmQgKG5vdCByZXYxKSByZXYyKQogICAgIChl cnJvciAiTm90IGEgdmFsaWQgcmV2aXNpb24gcmFuZ2UiKSkK --------------N2bCUcHdi4AXBW80XdY24yHR-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 04 07:39:06 2024 Received: (at 73232) by debbugs.gnu.org; 4 Oct 2024 11:39:06 +0000 Received: from localhost ([127.0.0.1]:34542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swgeH-00083m-Po for submit@debbugs.gnu.org; Fri, 04 Oct 2024 07:39:06 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:44889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swgeF-00083G-Qs for 73232@debbugs.gnu.org; Fri, 04 Oct 2024 07:39:04 -0400 From: Spencer Baugh To: Dmitry Gutov Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir In-Reply-To: <12a817d4-ca57-4951-b958-ed4eed96c521@gutov.dev> (Dmitry Gutov's message of "Sat, 28 Sep 2024 00:55:23 +0300") References: <864j6jjzzn.fsf@gnu.org> <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> <12a817d4-ca57-4951-b958-ed4eed96c521@gutov.dev> Date: Fri, 04 Oct 2024 07:38:55 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1728041935; bh=+nwciiq+GXmZev/E89HT810Jk4dGJ82rvKvpdBziY6o=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=x4l03CJp96HHdZtBvHhy6C8aLMcmmhxZtSJLxN5hPFsXUFDAGQDhijCCKBZ6ivTnO cFHoufeC38spqp8IBjeKpBUnoDZ3Oalw6ZoCIOhEAMkA/yRO/7AIPpMuH6Ntdo9JCc JNXg2m+c7qAkvZpW311SwlmM508YJ00SFvAMLXCnsncK/+fsLx4HMHb16lUfHQYSEb FXm5QcmzvMd+jMU4yeXRD3N714D/77DE6VHWX6Dp0uqBB3vhA1Egwr6VtWwtOm0Jqd K2IsYyrSd87m/3ytEPwfHz6xk1IzjUmZQQuxHD0JNQXXvQZfB9i1sB/y+/8Uy3QOGI JAEMIpd5/KeLA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73232 Cc: Eli Zaretskii , 73232@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > 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? 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 09 19:37:19 2024 Received: (at 73232-done) by debbugs.gnu.org; 9 Oct 2024 23:37:19 +0000 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 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 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) 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 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Oct 2024 19:36:56 -0400 (EDT) Message-ID: <2e74a175-50cb-49c9-89b3-cdf09482d66d@gutov.dev> Date: Thu, 10 Oct 2024 02:36:54 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir To: Spencer Baugh References: <864j6jjzzn.fsf@gnu.org> <304daaee-52d8-46ec-98f6-fda27908451e@gutov.dev> <12a817d4-ca57-4951-b958-ed4eed96c521@gutov.dev> Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73232-done Cc: Eli Zaretskii , 73232-done@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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. From unknown Fri Jun 20 07:11:29 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 07 Nov 2024 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator