all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: VC registered, but ignored
Date: Fri, 1 Sep 2023 12:16:42 +0300	[thread overview]
Message-ID: <e11ffc1b-5ffe-82bf-64b2-04a153d167d0@gutov.dev> (raw)
In-Reply-To: <83a5u6csoo.fsf@gnu.org>

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 <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"?

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.



  reply	other threads:[~2023-09-01  9:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 15:24 VC registered, but ignored Eli Zaretskii
2023-08-31 16:23 ` Dr. Arne Babenhauserheide
2023-08-31 16:49   ` Eli Zaretskii
2023-09-01  1:03 ` Dmitry Gutov
2023-09-01  6:29   ` Eli Zaretskii
2023-09-01  9:16     ` Dmitry Gutov [this message]
2023-09-01 11:33       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e11ffc1b-5ffe-82bf-64b2-04a153d167d0@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.