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

 
 

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

Submitted by:  Richard Neill <richardneill>
Submitted on:  Thu 11 May 2017 12:11:46 AM UTC  
 
Severity: 1 - WishStatus: Wont Fix
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

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

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 22 Jul 2017 07:52:38 PM UTCbensOpen/ClosedOpen=>Closed
    Tue 16 May 2017 07:36:22 PM UTCbensStatusNone=>Wont Fix
      Summary[Request] warn of editing conflicts=>[Request] warn immediately when the on-disk file changes
    Thu 11 May 2017 09:40:22 AM UTCbensSeverity3 - Normal=>1 - Wish
      Assigned toNone=>bens
      SummaryRequest: Warn of editing conflicts=>[Request] warn of editing conflicts

    Back to the top


    Powered by Savane 3.1-cleanup1