=C3=93scar?= Fuentes | 22 Sep 2009 04:26

bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status


Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the emacs-pretest-bug <at> gnu.org mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

When a modified versioned file is edited in such a way that the
modifications undoes previous changes to the file, after saving it the
VC-dired buffer for the working copy is automatically updated showing
that the status of the file is "up to date", but the VC modeline for the
buffer that visits the file does not change and keeps indicating that
the file state is "locally modified".

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/local/share/emacs/23.1.50/etc/DEBUG for instructions.

In GNU Emacs 23.1.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2009-09-06 on qcore
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
configured using `configure  '--with-x-toolkit=lucid''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
(Continue reading)

Dan Nicolaescu | 23 Sep 2009 07:53
Picon

bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status

ofv <at> wanadoo.es. "(Óscar" Fuentes) writes:

  > Please write in English if possible, because the Emacs maintainers
  > usually do not have translators to read other languages for them.
  > 
  > Your bug report will be posted to the emacs-pretest-bug <at> gnu.org mailing list.
  > 
  > Please describe exactly what actions triggered the bug
  > and the precise symptoms of the bug:
  > 
  > When a modified versioned file is edited in such a way that the
  > modifications undoes previous changes to the file, after saving it the
  > VC-dired buffer for the working copy is automatically updated showing
  > that the status of the file is "up to date", but the VC modeline for the
  > buffer that visits the file does not change and keeps indicating that
  > the file state is "locally modified".

Can you please describe step by step the actions necessary to reproduce
this starting from emacs -Q?

Óscar Fuentes | 23 Sep 2009 08:49
Picon

bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status

Dan Nicolaescu <dann <at> ics.uci.edu> writes:

> ofv <at> wanadoo.es. "(Óscar" Fuentes) writes:
>
>   > Please write in English if possible, because the Emacs maintainers
>   > usually do not have translators to read other languages for them.
>   > 
>   > Your bug report will be posted to the emacs-pretest-bug <at> gnu.org mailing list.
>   > 
>   > Please describe exactly what actions triggered the bug
>   > and the precise symptoms of the bug:
>   > 
>   > When a modified versioned file is edited in such a way that the
>   > modifications undoes previous changes to the file, after saving it the
>   > VC-dired buffer for the working copy is automatically updated showing
>   > that the status of the file is "up to date", but the VC modeline for the
>   > buffer that visits the file does not change and keeps indicating that
>   > the file state is "locally modified".
>
> Can you please describe step by step the actions necessary to reproduce
> this starting from emacs -Q?

emacs -Q

C-x C-f some-versioned-unmodified-file
do some edition
C-x C-s (the VC status modeline indicator changes from `-' to `:')
undo previous edition
C-x C-s

(Continue reading)

Dan Nicolaescu | 23 Sep 2009 20:36
Picon

bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status

Óscar Fuentes <ofv <at> wanadoo.es> writes:

  > Dan Nicolaescu <dann <at> ics.uci.edu> writes:
  > 
  > > ofv <at> wanadoo.es. "(Óscar" Fuentes) writes:
  > >
  > >   > Please write in English if possible, because the Emacs maintainers
  > >   > usually do not have translators to read other languages for them.
  > >   > 
  > >   > Your bug report will be posted to the emacs-pretest-bug <at> gnu.org mailing list.
  > >   > 
  > >   > Please describe exactly what actions triggered the bug
  > >   > and the precise symptoms of the bug:
  > >   > 
  > >   > When a modified versioned file is edited in such a way that the
  > >   > modifications undoes previous changes to the file, after saving it the
  > >   > VC-dired buffer for the working copy is automatically updated showing
  > >   > that the status of the file is "up to date", but the VC modeline for the
  > >   > buffer that visits the file does not change and keeps indicating that
  > >   > the file state is "locally modified".
  > >
  > > Can you please describe step by step the actions necessary to reproduce
  > > this starting from emacs -Q?
  > 
  > emacs -Q
  > 
  > C-x C-f some-versioned-unmodified-file
  > do some edition
  > C-x C-s (the VC status modeline indicator changes from `-' to `:')
  > undo previous edition
(Continue reading)

Óscar Fuentes | 23 Sep 2009 21:31
Picon

bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status

Dan Nicolaescu <dann <at> ics.uci.edu> writes:

> Óscar Fuentes <ofv <at> wanadoo.es> writes:
>
>   > Dan Nicolaescu <dann <at> ics.uci.edu> writes:
>   > 
>   > > ofv <at> wanadoo.es. "(Óscar" Fuentes) writes:
>   > >
>   > >   > Please write in English if possible, because the Emacs maintainers
>   > >   > usually do not have translators to read other languages for them.
>   > >   > 
>   > >   > Your bug report will be posted to the emacs-pretest-bug <at> gnu.org mailing list.
>   > >   > 
>   > >   > Please describe exactly what actions triggered the bug
>   > >   > and the precise symptoms of the bug:
>   > >   > 
>   > >   > When a modified versioned file is edited in such a way that the
>   > >   > modifications undoes previous changes to the file, after saving it the
>   > >   > VC-dired buffer for the working copy is automatically updated showing
>   > >   > that the status of the file is "up to date", but the VC modeline for the
>   > >   > buffer that visits the file does not change and keeps indicating that
>   > >   > the file state is "locally modified".
>   > >
>   > > Can you please describe step by step the actions necessary to reproduce
>   > > this starting from emacs -Q?
>   > 
>   > emacs -Q
>   > 
>   > C-x C-f some-versioned-unmodified-file
>   > do some edition
(Continue reading)

Stefan Monnier | 24 Sep 2009 04:25
Picon

bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status

> Automatically checking the VC state after each save is actually
> performed if there is a vc-dired buffer for the working copy where the
> file resides. That check updates the vc-dired with the correct state of
> the saved file.

Indeed.  That requires the status info to be obtainable cheaply.

> Would you accept a patch that implements an option for checking after
> every save and updating the vc state on the modeline accordingly?

I'd consider it, yes.

        Stefan

Dan Nicolaescu | 24 Sep 2009 06:24
Picon

bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status

Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

  > > Automatically checking the VC state after each save is actually
  > > performed if there is a vc-dired buffer for the working copy where the
  > > file resides. That check updates the vc-dired with the correct state of
  > > the saved file.
  > 
  > Indeed.  That requires the status info to be obtainable cheaply.

There's a major difference: vc-dir is asynchronous, whereas updating the
same info when saving a file is synchronous, so it will be on the
critical path.

Óscar Fuentes | 24 Sep 2009 08:24
Picon

bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status

Dan Nicolaescu <dann <at> ics.uci.edu> writes:

> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
>   > > Automatically checking the VC state after each save is actually
>   > > performed if there is a vc-dired buffer for the working copy where the
>   > > file resides. That check updates the vc-dired with the correct state of
>   > > the saved file.
>   > 
>   > Indeed.  That requires the status info to be obtainable cheaply.
>
> There's a major difference: vc-dir is asynchronous, whereas updating the
> same info when saving a file is synchronous, so it will be on the
> critical path.

Are you saying that vc-dir updates the file status asynchronously after
a file is saved? vc-dir-recompute-file-state does

	 (state (vc-call-backend vc-dir-backend 'state fname))
	 (extra (vc-call-backend vc-dir-backend
				 'status-fileinfo-extra fname)))

which looks like the same stuff vc-after-save is trying to avoid.

I've implemented the option for checking the state after every save. It
is almost instantaneous on a GNU/Linux machine with bzr. On a Windows XP
netbook there is almost no noticeable delay with a hot cache. Using bzr
2.0rc on a 1000 rev branch. The option is off by default so the user
must toggle the option before complaining about the performance. The
docstring of the defcustom warns about that posibility.
(Continue reading)

Dan Nicolaescu | 24 Sep 2009 19:20
Picon

bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status

Óscar Fuentes <ofv <at> wanadoo.es> writes:

  > Dan Nicolaescu <dann <at> ics.uci.edu> writes:
  > 
  > > Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
  > >
  > >   > > Automatically checking the VC state after each save is actually
  > >   > > performed if there is a vc-dired buffer for the working copy where the
  > >   > > file resides. That check updates the vc-dired with the correct state of
  > >   > > the saved file.
  > >   > 
  > >   > Indeed.  That requires the status info to be obtainable cheaply.
  > >
  > > There's a major difference: vc-dir is asynchronous, whereas updating the
  > > same info when saving a file is synchronous, so it will be on the
  > > critical path.
  > 
  > Are you saying that vc-dir updates the file status asynchronously after
  > a file is saved? vc-dir-recompute-file-state does

Hmm, I implemented that probably 2 years ago ago, but it does not look
like I checked it in...  and I can't seem to find that patch anymore.  :-(

  > 	 (state (vc-call-backend vc-dir-backend 'state fname))
  > 	 (extra (vc-call-backend vc-dir-backend
  > 				 'status-fileinfo-extra fname)))

This function should instead be using `vc-dir-refresh-files' to work
asynchronously.

(Continue reading)

Dan Nicolaescu | 23 Sep 2009 23:21
Picon

bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status

Óscar Fuentes <ofv <at> wanadoo.es> writes:

  > Dan Nicolaescu <dann <at> ics.uci.edu> writes:
  > 
  > > Óscar Fuentes <ofv <at> wanadoo.es> writes:
  > >
  > >   > Dan Nicolaescu <dann <at> ics.uci.edu> writes:
  > >   > 
  > >   > > ofv <at> wanadoo.es. "(Óscar" Fuentes) writes:
  > >   > >
  > >   > >   > Please write in English if possible, because the Emacs maintainers
  > >   > >   > usually do not have translators to read other languages for them.
  > >   > >   > 
  > >   > >   > Your bug report will be posted to the emacs-pretest-bug <at> gnu.org mailing list.
  > >   > >   > 
  > >   > >   > Please describe exactly what actions triggered the bug
  > >   > >   > and the precise symptoms of the bug:
  > >   > >   > 
  > >   > >   > When a modified versioned file is edited in such a way that the
  > >   > >   > modifications undoes previous changes to the file, after saving it the
  > >   > >   > VC-dired buffer for the working copy is automatically updated showing
  > >   > >   > that the status of the file is "up to date", but the VC modeline for the
  > >   > >   > buffer that visits the file does not change and keeps indicating that
  > >   > >   > the file state is "locally modified".
  > >   > >
  > >   > > Can you please describe step by step the actions necessary to reproduce
  > >   > > this starting from emacs -Q?
  > >   > 
  > >   > emacs -Q
  > >   > 
(Continue reading)

Kevin Rodgers | 24 Sep 2009 04:08
Picon

bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status

Dan Nicolaescu wrote:
> Óscar Fuentes <ofv <at> wanadoo.es> writes:
> 
>   > Dan Nicolaescu <dann <at> ics.uci.edu> writes:
...
>   > > Checking for this condition after each save is prohibitively expensive,
>   > > and it's an extremely rare event, so it's not worth optimizing for.
>   > 
>   > Automatically checking the VC state after each save is actually
>   > performed if there is a vc-dired buffer for the working copy where the
>   > file resides. That check updates the vc-dired with the correct state of
>   > the saved file.
...
>   > > So this is neither a bug, not something worth improving.
>   > 
>   > Well, the vc status on the modeline is showing the wrong state.
> 
>   > Would you accept a patch that implements an option for checking after
>   > every save and updating the vc state on the modeline accordingly?
> 
> Although I've done a lot of work on VC, I am not an official maintainer
> of VC, so I am in no position to do that.  But I don't think such a
> change is a good idea.

Should that feature be removed from vc-dired, so that it is consistent with the
buffer's mode line?

(No, I'm not serious.)

--

-- 
(Continue reading)


Gmane