bugGNU nano - Bugs: bug #50998, [Request] warn immediately when...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #50998: [Request] warn immediately when the on-disk file changes

Submitter:  Richard Neill <richardneill>
Submitted:  Thu 11 May 2017 12:11:46 AM UTC
   
 
Severity:  1 - Wish Status:  Wont Fix
Assigned to:  bens Open/Closed:  Closed

Thu 29 Jun 2017 09:05:28 AM UTC, comment #5: 

Mitigated in git, commit 139f9c2f: the warning is more conspicuous.

Benno Schulenberg <bens>
Group administrator
Tue 16 May 2017 07:36:22 PM UTC, comment #4: 

I regularly get such a warning from Gedit or Geany because I have moved or deleted the relevant file, so I know what you mean.

But editors that are comparable to nano (that is: that run in a terminal), also only warn at the moment that the user tries to save the file.  Admitted, the warning from vim is much more conspicuous: a bright red bar, plus a question on a second line.  Emacs is more subdued, and checks also at the moment that you actually start editing, and will automatically make a backup when you do decide to continue or save the file.  But neither of them throws up a warning at the moment that the file changes on disk.  And I don't think that nano should do that either: it interrupts the user in their editing process, and probably confuses them: what should they do now?

Anyway, I will see if I can make nano's warning stand out more.

(To come back for a moment to your four-step example.  Ad 2: one really shouldn't do a git pull when one is in the middle of editing.  Ad 4: doesn't one do a git diff before doing a git commit?  And doesn't one do a git log -p -1 afterward to make sure everything is as intended?)

The problem with 'savefile' and --tempfile not giving any warning I have reported as bug #51040.  But this request for inotify support I am going to mark as wontfix.

Benno Schulenberg <bens>
Group administrator
Tue 16 May 2017 01:06:51 PM UTC, comment #3: 

Hi - yes, I do get the "File was modified" warning, at the end when I attempt to save the file.  So in fact, this issue is less of a problem than I first thought it was (and the most serious risk, of making an error and never knowing about it is mitigated).

However, other editors give the "File was modified" warning immediately when it is changed - which is perhaps a bit more user-friendly. Try the kwrite/gedit behaviour to see what I mean.


Richard Neill <richardneill>
Tue 16 May 2017 07:39:28 AM UTC, comment #2: 

Richard?  Can you confirm that you indeed get the "File was modified" warning?  Or do you use --tempfile?  Or have you bound the 'savefile' function?

Benno Schulenberg <bens>
Group administrator
Thu 11 May 2017 09:40:22 AM UTC, comment #1: 

Doing the save in step 3 should bring up the following warning:

  File was modified since you opened it; continue saving?

Aah... but not when you've bound the savefile function and use that.  Oops.  That needs to change.  Thanks for reporting.

Benno Schulenberg <bens>
Group administrator
Thu 11 May 2017 12:11:46 AM UTC, original submission:  

If a file is open within nano, and the file is changed by a different process, nano does not notify the user. Other editors will warn if this happens.

For example:
1. Open a file in kwrite:  kwrite example.txt  and start typing.
2. In a different shell, clobber it:  echo oops > example.txt

Kwrite immediately warns "The file "example.txt" was created/modified by another program."
[I think this is done using inotify.]

Nano does warn, very helpfully, if 2 instances of nano are simultaneously attempting to edit the file. However, it won't detect something like the following:

1. Open somefile.txt for editing in nano, and start typing.
2. In a different shell, git-pull. This brings in various changes including a change to the file somefile.txt (which you might not notice).
3. Save in nano.
4. Git commit/push

Now, we've overwritten someone else's change, and we didn't notice it.

Thanks very much.





Richard Neill <richardneill>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by richardneill (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-07-22 bens Open/ClosedOpen Closed
    2017-05-16 bens StatusNone Wont Fix
        Summary[Request] warn of editing conflicts [Request] warn immediately when the on-disk file changes
    2017-05-11 bens Severity3 - Normal 1 - Wish
        Assigned toNone bens
        SummaryRequest: Warn of editing conflicts [Request] warn of editing conflicts

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code