* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
@ 2014-09-28 22:17 Dmitry Gutov
2014-09-29 2:14 ` Stefan Monnier
2014-09-29 13:29 ` Stefan Monnier
0 siblings, 2 replies; 20+ messages in thread
From: Dmitry Gutov @ 2014-09-28 22:17 UTC (permalink / raw)
To: 18579
Tags: patch
Description of `dir-status-files' in vc.el says that this command's
output should include ignored files. vc-git implementation does, vc-bzr
implementation doesn't.
This is a problem in the context of the current feature request for
diff-hl to highlight ignored files in Dired buffers:
https://github.com/dgutov/diff-hl/issues/25
The trivial patch at the bottom seems to work okay.
In GNU Emacs 24.3.93.4 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
of 2014-09-19 on axl
Repository revision: 117510 juri@jurta.org-20140918205955-kwp5ckzrk2l4w1km
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description: Ubuntu 14.04.1 LTS
=== modified file 'lisp/vc/vc-bzr.el'
--- lisp/vc/vc-bzr.el 2014-02-10 01:34:22 +0000
+++ lisp/vc/vc-bzr.el 2014-09-28 22:10:02 +0000
@@ -983,7 +983,7 @@
(push (list new-name 'edited
(vc-bzr-create-extra-fileinfo old-name)) result)))
;; do nothing for non existent files
- ((memq translated '(not-found ignored)))
+ ((memq translated '(not-found)))
(t
(push (list (file-relative-name
(buffer-substring-no-properties
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-28 22:17 bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files Dmitry Gutov
@ 2014-09-29 2:14 ` Stefan Monnier
2014-09-29 2:21 ` Dmitry Gutov
2014-09-29 2:29 ` Dmitry Gutov
2014-09-29 13:29 ` Stefan Monnier
1 sibling, 2 replies; 20+ messages in thread
From: Stefan Monnier @ 2014-09-29 2:14 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 18579
> Description of `dir-status-files' in vc.el says that this command's
> output should include ignored files.
I wonder why it should include `ignored'? Is it needed somewhere?
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-29 2:14 ` Stefan Monnier
@ 2014-09-29 2:21 ` Dmitry Gutov
2014-09-29 2:34 ` Stefan Monnier
2014-09-29 2:29 ` Dmitry Gutov
1 sibling, 1 reply; 20+ messages in thread
From: Dmitry Gutov @ 2014-09-29 2:21 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18579
On 09/29/2014 06:14 AM, Stefan Monnier wrote:
>> Description of `dir-status-files' in vc.el says that this command's
>> output should include ignored files.
>
> I wonder why it should include `ignored'? Is it needed somewhere?
I don't see a place in VC code where it's used.
However, it makes sense in general, and it's quite essential to my
ability to retrieve the list of ignored files in a given directory in
VCS-agnostic way.
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-29 2:21 ` Dmitry Gutov
@ 2014-09-29 2:34 ` Stefan Monnier
2014-09-29 2:39 ` Dmitry Gutov
0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2014-09-29 2:34 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 18579
>>> Description of `dir-status-files' in vc.el says that this command's
>>> output should include ignored files.
>> I wonder why it should include `ignored'? Is it needed somewhere?
> I don't see a place in VC code where it's used.
Good, thanks.
> However, it makes sense in general, and it's quite essential to my ability
> to retrieve the list of ignored files in a given directory in
> VCS-agnostic way.
Problem is: it could be difficult for some backends to list those files.
Why do you need such a list?
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-29 2:34 ` Stefan Monnier
@ 2014-09-29 2:39 ` Dmitry Gutov
0 siblings, 0 replies; 20+ messages in thread
From: Dmitry Gutov @ 2014-09-29 2:39 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18579
On 09/29/2014 06:34 AM, Stefan Monnier wrote:
> Problem is: it could be difficult for some backends to list those files.
vc-bzr seems to manage just fine, if we let it. I may or may not care
about backends where this could be a problem.
> Why do you need such a list?
I've mentioned the reason in the bug report: a user asked for a new
feature in a third-party package (included in GNU ELPA). After
implementing it, I kind of like the feature myself.
If some backward backend doesn't support it, though, diff-hl-dired will
degrade gracefully. I'd just hoped that the most popular backends would
provide such support.
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-29 2:14 ` Stefan Monnier
2014-09-29 2:21 ` Dmitry Gutov
@ 2014-09-29 2:29 ` Dmitry Gutov
2014-09-29 13:24 ` Stefan Monnier
1 sibling, 1 reply; 20+ messages in thread
From: Dmitry Gutov @ 2014-09-29 2:29 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18579
Here's a minor example of it being used:
1. Create a new file in an existing repository, open the vc-dir buffer,
see it listed as "unregistered".
2. Type `M-x vc-ignore', select the current file, press RET. Its name is
added to .gitignore.
3. Refresh the already opened `vc-dir' buffer. That file is now listed
as "ignored".
This somewhat mirrors the behavior of edited -> up-to-date status
change, except the info in `vc-dir' doesn't update automatically. Which
could be considered a separate bug.
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-29 2:29 ` Dmitry Gutov
@ 2014-09-29 13:24 ` Stefan Monnier
2014-09-29 22:51 ` Dmitry Gutov
0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2014-09-29 13:24 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 18579
> This somewhat mirrors the behavior of edited -> up-to-date status change,
> except the info in `vc-dir' doesn't update automatically. Which could be
> considered a separate bug.
It's definitely a (separate) bug: right after M-x vc-ignore, it should
either appear as `ignored' or disappear (either way is fine by me).
But here's a related question: if we fix this bug (i.e. the file appears
as `ignored' after the call to M-x vc-ignore, or disappears), why would
we need dir-status to list the file as `ignored'?
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-29 13:24 ` Stefan Monnier
@ 2014-09-29 22:51 ` Dmitry Gutov
2014-09-30 0:31 ` Stefan Monnier
0 siblings, 1 reply; 20+ messages in thread
From: Dmitry Gutov @ 2014-09-29 22:51 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18579
On 09/29/2014 05:24 PM, Stefan Monnier wrote:
> But here's a related question: if we fix this bug (i.e. the file appears
> as `ignored' after the call to M-x vc-ignore, or disappears), why would
> we need dir-status to list the file as `ignored'?
Maybe we won't, as far as this purpose goes.
Though maybe not updating immediately was a conscious decision, of
sorts. After all, instead of calling `vc-ignore', I could edit
.gitignore by hand.
Then, if we decide that the buffer should be listed as `ignored' after
`vc-ignore' call, the result of an edit by hand + `vc-dir-refresh' would
be different: the file will disappear from the list.
Whereas it doesn't matter if I use the `vc-revert' command or `git co
path/to/file', the file item in the `vc-dir' buffer will revert to
`up-to-date', immediately in the former case, and after `vc-dir-refresh'
in the latter case.
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-29 22:51 ` Dmitry Gutov
@ 2014-09-30 0:31 ` Stefan Monnier
2014-09-30 0:33 ` Dmitry Gutov
0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2014-09-30 0:31 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 18579
> Maybe we won't, as far as this purpose goes. Though maybe not
> updating immediately was a conscious decision, of sorts.
I don't think so.
> Then, if we decide that the buffer should be listed as `ignored' after
> `vc-ignore' call, the result of an edit by hand + `vc-dir-refresh' would be
> different: the file will disappear from the list.
That would be undesirable, indeed. I think that vc-dir-refresh should
never remove entries: only vc-dir-hide-up-to-date should do that.
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-30 0:31 ` Stefan Monnier
@ 2014-09-30 0:33 ` Dmitry Gutov
2014-09-30 3:38 ` Stefan Monnier
0 siblings, 1 reply; 20+ messages in thread
From: Dmitry Gutov @ 2014-09-30 0:33 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18579
On 09/30/2014 04:31 AM, Stefan Monnier wrote:
>> Then, if we decide that the buffer should be listed as `ignored' after
>> `vc-ignore' call, the result of an edit by hand + `vc-dir-refresh' would be
>> different: the file will disappear from the list.
>
> That would be undesirable, indeed. I think that vc-dir-refresh should
> never remove entries: only vc-dir-hide-up-to-date should do that.
Then the file would still be listed as `unregistered', wouldn't it?
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-30 0:33 ` Dmitry Gutov
@ 2014-09-30 3:38 ` Stefan Monnier
2014-09-30 15:06 ` Dmitry Gutov
0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2014-09-30 3:38 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 18579
>>> Then, if we decide that the buffer should be listed as `ignored' after
>>> `vc-ignore' call, the result of an edit by hand + `vc-dir-refresh' would be
>>> different: the file will disappear from the list.
>> That would be undesirable, indeed. I think that vc-dir-refresh should
>> never remove entries: only vc-dir-hide-up-to-date should do that.
> Then the file would still be listed as `unregistered', wouldn't it?
That would be wrong: vc-dir-refresh shouldn't remove entries, but it
should update them (i.e. turn the `unregistered' into `ignored' in this
specific case).
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-30 3:38 ` Stefan Monnier
@ 2014-09-30 15:06 ` Dmitry Gutov
2014-09-30 18:07 ` Stefan Monnier
0 siblings, 1 reply; 20+ messages in thread
From: Dmitry Gutov @ 2014-09-30 15:06 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18579
On 09/30/2014 07:38 AM, Stefan Monnier wrote:
> That would be wrong: vc-dir-refresh shouldn't remove entries, but it
> should update them (i.e. turn the `unregistered' into `ignored' in this
> specific case).
AFAICT, for that to happen, `dir-status-files' should include files with
`ignored' state. The above scenario currently fails with VC-Bzr.
Do you think I can install the simple patch, attached originally, into
emacs-24? I think we've established that it should be pretty safe.
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-30 15:06 ` Dmitry Gutov
@ 2014-09-30 18:07 ` Stefan Monnier
2014-10-01 2:11 ` Dmitry Gutov
2014-11-24 2:19 ` Dmitry Gutov
0 siblings, 2 replies; 20+ messages in thread
From: Stefan Monnier @ 2014-09-30 18:07 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 18579
>> That would be wrong: vc-dir-refresh shouldn't remove entries, but it
>> should update them (i.e. turn the `unregistered' into `ignored' in this
>> specific case).
> AFAICT, for that to happen, `dir-status-files' should include files with
> `ignored' state. The above scenario currently fails with VC-Bzr.
I think you're right, indeed.
> Do you think I can install the simple patch, attached originally, into
> emacs-24?
No.
> I think we've established that it should be pretty safe.
Not safe enough. You can install it into emacs-24 after we release
24.4, tho.
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-30 18:07 ` Stefan Monnier
@ 2014-10-01 2:11 ` Dmitry Gutov
2014-11-24 2:19 ` Dmitry Gutov
1 sibling, 0 replies; 20+ messages in thread
From: Dmitry Gutov @ 2014-10-01 2:11 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18579
On 09/30/2014 10:07 PM, Stefan Monnier wrote:
> Not safe enough. You can install it into emacs-24 after we release
> 24.4, tho.
Ok. Here's hoping it happens soon.
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-30 18:07 ` Stefan Monnier
2014-10-01 2:11 ` Dmitry Gutov
@ 2014-11-24 2:19 ` Dmitry Gutov
1 sibling, 0 replies; 20+ messages in thread
From: Dmitry Gutov @ 2014-11-24 2:19 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18579-done
Version: 24.5
On 09/30/2014 09:07 PM, Stefan Monnier wrote:
> You can install it into emacs-24 after we release 24.4, tho.
Done, as well as a patch for vc-hg with similar effect.
'hg status' can also list up-to-date files, but that makes the command
take noticeably more time in larger repositories (1.2s vs 0.7s in
mozilla-central, on my machine), so I figure we can live without it for now.
If/when someone decides to work on returning up-to-date files across
different backends, they should open a new bug.
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-28 22:17 bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files Dmitry Gutov
2014-09-29 2:14 ` Stefan Monnier
@ 2014-09-29 13:29 ` Stefan Monnier
2014-09-29 23:05 ` Dmitry Gutov
2014-10-03 1:03 ` Dmitry Gutov
1 sibling, 2 replies; 20+ messages in thread
From: Stefan Monnier @ 2014-09-29 13:29 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 18579
> This is a problem in the context of the current feature request for
> diff-hl to highlight ignored files in Dired buffers:
> https://github.com/dgutov/diff-hl/issues/25
Why does this feature need an `ignored' value for the ignored files?
I thought we could simply say that any file which is not
edited/up-to-date/unknown is assumed to be ignored.
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-29 13:29 ` Stefan Monnier
@ 2014-09-29 23:05 ` Dmitry Gutov
2014-09-30 0:34 ` Stefan Monnier
2014-10-03 1:03 ` Dmitry Gutov
1 sibling, 1 reply; 20+ messages in thread
From: Dmitry Gutov @ 2014-09-29 23:05 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18579
On 09/29/2014 05:29 PM, Stefan Monnier wrote:
> Why does this feature need an `ignored' value for the ignored files?
> I thought we could simply say that any file which is not
> edited/up-to-date/unknown is assumed to be ignored.
A backend implementation could use that logic, no problem.
As a VC API consumer, though, I don't really know, for an arbitrary VCS
V, if the states that files can have in V, are:
- Fully represented by the list in `vc-state' docstring.
- All implemented by `vc-v'.
The backend may be ignorant of some of them, not all of which might be
`ignored'.
And anyway, it's nice to be able to just call the function and filter
the list passed to the callback by item states, and not have to
implement set subtraction.
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-29 23:05 ` Dmitry Gutov
@ 2014-09-30 0:34 ` Stefan Monnier
2014-09-30 1:23 ` Dmitry Gutov
0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2014-09-30 0:34 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 18579
> And anyway, it's nice to be able to just call the function and filter the
> list passed to the callback by item states, and not have to implement
> set subtraction.
I guess it's OK to return `ignored' files, but I don't think the API
should require it. E.g. for vc-cvs.el it's pretty difficult to list the
ignored files, IIRC.
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-30 0:34 ` Stefan Monnier
@ 2014-09-30 1:23 ` Dmitry Gutov
0 siblings, 0 replies; 20+ messages in thread
From: Dmitry Gutov @ 2014-09-30 1:23 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18579
On 09/30/2014 04:34 AM, Stefan Monnier wrote:
> I guess it's OK to return `ignored' files, but I don't think the API
> should require it. E.g. for vc-cvs.el it's pretty difficult to list the
> ignored files, IIRC.
I think that's ok, we should understand that not all backend
implementations are perfect.
The API describes the ideal, and also how functions differ from each
other. Mentioning `ignored' in `dir-status-files' description is useful,
because it should include ignored files (if possible), whereas
`dir-status', a quite similar command otherwise, is allowed to omit
up-to-date and ignored files (probably should even be recommended to
omit them, for performance reasons).
And shouldn't vc-cvs.el implementation be able to use the trick you
described earlier, and assign the status `ignored' to all files whose
status it didn't find?
^ permalink raw reply [flat|nested] 20+ messages in thread
* bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files
2014-09-29 13:29 ` Stefan Monnier
2014-09-29 23:05 ` Dmitry Gutov
@ 2014-10-03 1:03 ` Dmitry Gutov
1 sibling, 0 replies; 20+ messages in thread
From: Dmitry Gutov @ 2014-10-03 1:03 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18579
On 09/29/2014 05:29 PM, Stefan Monnier wrote:
> Why does this feature need an `ignored' value for the ignored files?
> I thought we could simply say that any file which is not
> edited/up-to-date/unknown is assumed to be ignored.
Here's another reason why this is not ideal: vc-bzr doesn't include
up-to-date files in the `dir-status-files' results either.
Since there's no apparent switch in `bzr status' for that, I guess these
entries could be determined by exclusion.
`vc-svn-dir-status-files' has a similar problem, except its status
output doesn't distinguish between up-to-date and not-found files. We
could either ignore that problem and do as with Bzr above, or call `svn
status' with switch "-v", and parse the output in the different format.
`vc-hg-dir-status-files' doesn't include ignored files, nor up-to-date
files, which is weird, given that `vc-hg-after-dir-status' tries to
parse these statuses. Apparently, we should add a "-A" switch in
`vc-hg-dir-status-files'.
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2014-11-24 2:19 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-28 22:17 bug#18579: 24.3.93; vc-bzr-after-dir-status should not skip ignored files Dmitry Gutov
2014-09-29 2:14 ` Stefan Monnier
2014-09-29 2:21 ` Dmitry Gutov
2014-09-29 2:34 ` Stefan Monnier
2014-09-29 2:39 ` Dmitry Gutov
2014-09-29 2:29 ` Dmitry Gutov
2014-09-29 13:24 ` Stefan Monnier
2014-09-29 22:51 ` Dmitry Gutov
2014-09-30 0:31 ` Stefan Monnier
2014-09-30 0:33 ` Dmitry Gutov
2014-09-30 3:38 ` Stefan Monnier
2014-09-30 15:06 ` Dmitry Gutov
2014-09-30 18:07 ` Stefan Monnier
2014-10-01 2:11 ` Dmitry Gutov
2014-11-24 2:19 ` Dmitry Gutov
2014-09-29 13:29 ` Stefan Monnier
2014-09-29 23:05 ` Dmitry Gutov
2014-09-30 0:34 ` Stefan Monnier
2014-09-30 1:23 ` Dmitry Gutov
2014-10-03 1:03 ` Dmitry Gutov
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).