editor backup file left over after bzr commit

Bug #199659 reported by Wesley J. Landaker
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

When doing a raw "bzr commit" with no -m, an editor is fired up on a temporary file with a name like "bzr_log.1ySd21". Once this is saved, the editor exits, and commit is successful, the file is deleted. However, many editors leave a backup file with a trailing tilde lying around afterward, e.g. "bzr_log.1ySd21~".

Since this type of backup file is left by most common UNIX editors (e.g. vim, emacs, xemacs, nano, nedit, kate, etc) it makes sense that bzr would go ahead and remove not just it's temporary file, but also that filename+"~".

I suppose there could be some (crazy?) concern that maybe the USER has a REAL file that they want to KEEP named "bzr_log.something~" and this would potentially overwrite it. To address that possible concern, keep in mind that already this is a "problem": if you have a file named "something~" and you pull up any UNIX editor on a file named "something", it will clobber the original "something~" file. So bzr deleting this file is no worse than what it already does. But see another idea below:

An alternate -- and safer -- method that would be to create a unique directory "bzr_log.whatever" and put the log file in there, e.g. "bzr_log.whatever/log" and then remove the directory and it's contents afterward, which would get rid of the pesky "~" backup file, would prevent any possible user data clobbering, and would be robust to any sort of editor backup naming scheme.

Tags: easy
Revision history for this message
Alexander Belchenko (bialix) wrote :

I think it's reasonable. At least commit command could provide special command-line flag to force such behavior. It should be easy to fix.

Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 199659] [NEW] editor backup file left over after bzr commit

A cleaner approach would be to put the bzr temp log in a subdir, and
rmtree the subdir after the commit.

-Rob

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.