From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: VC registered, but ignored Date: Fri, 01 Sep 2023 09:29:27 +0300 Message-ID: <83a5u6csoo.fsf@gnu.org> References: <83pm33ck07.fsf@gnu.org> <24cfce4b-25ed-b27e-05c3-4f1668ed7b34@gutov.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2752"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 01 08:30:47 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 1qbxg6-0000Ui-Dn for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Sep 2023 08:30:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbxf5-0006Yj-QT; Fri, 01 Sep 2023 02:29:43 -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 1qbxf5-0006QC-18 for emacs-devel@gnu.org; Fri, 01 Sep 2023 02:29:43 -0400 Original-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 1qbxf4-0001MW-Nk; Fri, 01 Sep 2023 02:29:42 -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=i8szE3UasLCM4maWvoBFFA/zd3U9vaJzZ37PZEXLOfY=; b=K4cj6FAA6CyA m+Jd4O1e4vlqdRMStZSR4ZPKDNyJ1lfVCgqyCvWsUYhs6xTW+GcAiqj9OXf+R9WCRhOysBt+YbXX1 gO1Ew5UNVzg/E6AmQPDwcs4ZryspVs8//OubJ+BQy3JsQYwF+0E2caZq5gEpUuyEj3QI+eHBQ+zQJ v18vHQ5X5IdUsp68Mxp5HQnGdcdoAgNelcwlS+ANFWgKNU9nrsc8RSOEKFuOA9XMTgy935aIb0Z4P JLbOlip08v0ORqKZlwUc5Wv8fHBUr+ird8joimOm/ozu7Hk55Ttt3QclBrpURK0tLqKdkP/WTmIZ4 +hTCBcx3rhJbRVn/wem5IA==; In-Reply-To: <24cfce4b-25ed-b27e-05c3-4f1668ed7b34@gutov.dev> (message from Dmitry Gutov on Fri, 1 Sep 2023 04:03:43 +0300) 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:309722 Archived-At: > 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"? > 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. The value nil is the expected value for a file that is not registered. 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. > 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. > 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.)