After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 156085 - Document autosave overwrites file modified externally
Document autosave overwrites file modified externally
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.8.x
Other other
: High major
: ---
Assigned To: Gedit maintainers
gedit QA volunteers
Depends on:
Blocks: 130389
 
 
Reported: 2004-10-21 18:57 UTC by Evan Prodromou
Modified: 2005-12-15 16:02 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8



Description Evan Prodromou 2004-10-21 18:57:40 UTC
Distribution: Debian 3.1
Package: gedit
Severity: major
Version: GNOME2.8.1 2.8.x
Gnome-Distributor: Debian
Synopsis: Document autosave overwrites file modified externally
Bugzilla-Product: gedit
Bugzilla-Component: general
Bugzilla-Version: 2.8.x
Description:
Description of Problem:

I occasionally open a file in gedit to check a problem, and then modify
the file with another tool (Perl, sed, whatever). With autosave turned
on, gedit will save the file without checking that it's been externally
modified -- overwriting my external changes.

Steps to reproduce the problem:
1. Turn on autosave in Preferences.
2. Open a file in gedit.
3. In another window, change the file with another tool (and possibly
another gedit instance...?)
4. Wait N minutes.
5. Check the file.

Actual Results:

The version in the gedit window will have been autowritten to the file.

Expected Results:

gedit wouldn't write to the file if it has been modified since the last
gedit save.

How often does this happen?

Every time.

Additional Information:

Lots of text editors check the last mod time of a file against a
recorded last save time. It might be a good idea to do this globally.




------- Bug moved to this database by unknown@bugzilla.gnome.org 2004-10-21 14:57 -------


Unknown platform unknown. Setting to default platform "Other".
Unknown milestone "unknown" in product "gedit".
   Setting to default milestone for this product, '---'
Setting to default status "UNCONFIRMED".
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.

Comment 1 Paolo Maggi 2004-12-05 17:10:25 UTC
I agree with you. We should fix this problem.
Comment 2 Pedro Corte-Real 2005-02-08 16:26:26 UTC
This is not an AutoSave problem. I don't use autosave and get bitten by this bug
when I'm editing stuff that's CVS controlled. 

I edit the file locally, and save and commit it to CVS. If I later on update the
file from CVS and edit it again gedit won't notice the file changed from under
it and will overwrite it. 

Emacs detects that the file has changed when it's being saved and asks if I want
to overwrite. A better option would be to detect that it has changed just when
it happens and ask the user if he wants to reload the file. libfam can be used
for this but doing both things is probably best, so that correct behaviour is
maintained when fam/gamin isn't working.
Comment 3 Paolo Borelli 2005-02-08 16:42:23 UTC
yep, monitoring files it is something that we should take into consideration
again at some point, see also http://bugzilla.gnome.org/show_bug.cgi?id=75861.

However, beside monitors, we should check the mtime of the file when saving.
Comment 4 Pedro Corte-Real 2005-02-08 16:50:33 UTC
yes, mtime checking was what I meant when I said that emacs checks if the file
has changed when saving.
Comment 5 Paolo Borelli 2005-12-15 16:02:53 UTC
We do mtime checking in 2.13.0... autosave is still a bit under work, but since
the actual saving is done in the document-saver and it takes mtime into account,
I think we can declare this fixed.