[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VC registered, but ignored

From: Eli Zaretskii
Subject: Re: VC registered, but ignored
Date: Fri, 01 Sep 2023 09:29:27 +0300

> Date: Fri, 1 Sep 2023 04:03:43 +0300
> Cc: emacs-devel@gnu.org
> From: Dmitry Gutov <dmitry@gutov.dev>
> 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.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]