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.devel Subject: Re: VC registered, but ignored Date: Fri, 1 Sep 2023 12:16:42 +0300 Message-ID: References: <83pm33ck07.fsf@gnu.org> <24cfce4b-25ed-b27e-05c3-4f1668ed7b34@gutov.dev> <83a5u6csoo.fsf@gnu.org> 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="40138"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 01 11:17:35 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qc0HW-000ACA-7w for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Sep 2023 11:17:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc0H1-00006G-LY; Fri, 01 Sep 2023 05:17:03 -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 1qc0Go-0008Oh-8V for emacs-devel@gnu.org; Fri, 01 Sep 2023 05:16:55 -0400 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc0Gl-0005Yf-UX; Fri, 01 Sep 2023 05:16:50 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id DAB35320091D; Fri, 1 Sep 2023 05:16:44 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 01 Sep 2023 05:16: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:sender:subject:subject:to:to; s=fm3; t= 1693559804; x=1693646204; bh=R+LWUtNNY5nwmHdJmWYyZtKIbaBEgZoqpB8 WFAnFc0o=; b=mdPHMmpvgSVoGPe/iyYIODbFOj8iwPqbMRJeHPhgWMxzqsG13KN DALVlwWk8kkQyVBo4owQx4tOKFr7NfmopwwQIiJ10I38vy1dP094p7lMKqsiF+/V ZZ62kn5/CwKeOxzPrB/cGFaEra36+zUkZamXo27+J1cD/RZ0v6+Sp63CSRsX2T4W DgJs/0rxkDa1iRIifTy08vaC9pv/4ZBa3U8qGO+/0EWgMnGew1juLq+fPvQ3mQ11 ebSkYWncrD7Pn+MvLHs7KWzJ/qLnTZi0YtKtLyv2qWTJaxylBGgFeXosZdR/koaE FdoLmGS014NH9R8defLjPZgqMW98qBjK+9g== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693559804; x=1693646204; bh=R+LWUtNNY5nwmHdJmWYyZtKIbaBEgZoqpB8 WFAnFc0o=; b=muO0gvwUwH/pcA4OcpLSrQbcstu45DYKJpNf5eigVgouMTXO0Y4 PGIWJWZxu+7L5HCsgFV+9q4CGmhPC2EjxSpTMzpSMCIQS1X1okc3L0yzE8o8pQ5n CY0PcUqxWJCL/0p8xb6R3scO3+PyRYj7QEmItI89GGAPBynhSmGWdefZdOd3edn+ qcy7OgYTY0TwkfYUMf+hv8OxUiWzOlhWmR3KPMKB+cyZL4qgLKODgrHhCtRd/AK0 ibi4dHzFcWfIS2Bdp9rNOdXdgmlE7QbLOOFfP9Oop8Om4wlPniAI72gnMLgrIsHL Xo3GpJyGNtjBBijmSMVQ2+NEpxg/xf9HWNw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegvddgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepjefhhedvvdektdetveekfedtfeehgfdufeevudegteeiteeuteeuvdfffeev tdffnecuffhomhgrihhnpegvlhdrhihouhenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Sep 2023 05:16:43 -0400 (EDT) Content-Language: en-US In-Reply-To: <83a5u6csoo.fsf@gnu.org> Received-SPF: pass client-ip=64.147.123.20; envelope-from=dmitry@gutov.dev; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -62 X-Spam_score: -6.3 X-Spam_bar: ------ X-Spam_report: (-6.3 / 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, NICE_REPLY_A=-3.478, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:309736 Archived-At: On 01/09/2023 09:29, Eli Zaretskii wrote: >> Date: Fri, 1 Sep 2023 04:03:43 +0300 >> Cc: emacs-devel@gnu.org >> From: Dmitry Gutov >> >> On 31/08/2023 18:24, Eli Zaretskii wrote: >>> In a repository where *.txt files are ignored, I added to VC a file >>> with the .txt extension, and was surprised to see the ':' indicator on >>> the mode line although the file was up-to-date. Moreover, the tooltip >>> said the file was "locally modified". That had me puzzled for a few >>> minutes, until I saw the code in vc-hooks.el. >> >> You added it with 'C-x v v'? > > No, from the shell prompt. Would the result have been different if I > did that with "C-x v v"? Not 100% sure, but that's not important -- I have my answer. >> We have a problem of sorts, or a break in the abstration, where >> (vc-state buffer-file-name) would return nil instead of 'ignored. > > Only if the file is not registered, right? Most/all ignored files are > not registered, they are generated files that we don't want to see in > VC status displays. Here I describe a situation that shouldn't > happen, but did. Apparently so. > The value nil is the expected value for a file that is not registered. It's more subtle that that, (vc-state buffer-file-name) would return nil in that case, but (vc-state buffer-file-name 'Git) would return 'ignored. That hasn't affected any practical code so far (AFAIK), but something to keep in mind. > In the case I described above, vc-state returns 'ignored, not nil. > And the result was that, instead of seeing no VC information on the > mode line, I saw a revision ID preceded by ':', as if the file was > locally modified. Ok. >> So the problem is your annotation won't show up if you just open an >> ignored file (for Git backend, at least). Is that okay for your purposes? > > No, see above. IIUC, you mean yes, the combined solution is okay for your purposes (if you open an unregistered ignored file, the annotation won't be there, and the whole mode-line item will be absent as well). >> As for which character to use, maybe a period? Although that depends on >> what you want to bring attention to: usually people are happy to keep >> ignored files ignored. > > Again, the file was NOT supposed to be ignored! I deliberately added > it to the repository, I just forgot that it had an extension of > ignored files. (The solution, once I relized the cause, was to exempt > that one file from the otherwise ignored *.txt files.) In that case, that indeed sounds like a situation that warrants additional attention, and "!" might be a good choice. So I think we can push the patch, and just be on the lookout for cases where it misfires. Thank you.