FS#12995 - vi shouldnt create backup files during installation

Attached to Project: Release Engineering
Opened by Greg (dolby) - Tuesday, 27 January 2009, 04:52 GMT
Last edited by Dieter Plaetinck (Dieter_be) - Sunday, 08 March 2009, 16:55 GMT
Task Type General Gripe
Category archlinux-installer (deprecate
Status Closed
Assigned To Dieter Plaetinck (Dieter_be)
Architecture All
Severity Low
Priority Normal
Reported Version 2009.01-beta
Due in Version 2009.08-alpha
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I am creating this here, as the problem is that this is affecting new installations. Vi doesnt contain set nobackup in its default config as it did in the past.
That results to creation of backups for files edited with vi during installation in your newly created system.

http://bugs.archlinux.org/task/12944#comment38214
This task depends upon

Closed by  Dieter Plaetinck (Dieter_be)
Sunday, 08 March 2009, 16:55 GMT
Reason for closing:  Implemented
Comment by Evangelos Foutras (foutrelis) - Tuesday, 27 January 2009, 14:14 GMT
I'm not sure about this. I'd rather keep the defaults set by the upstream developers. Personally, I don't like it either, but having the original configs backed up may be helpful to some people. ._.
Comment by Dieter Plaetinck (Dieter_be) - Thursday, 29 January 2009, 16:48 GMT
dolby, can you give a reason (other then personal preference) ?
Comment by Aaron Griffin (phrakture) - Thursday, 29 January 2009, 17:25 GMT
As I stated in the other bug: I actually think it may be useful, due to the fact that a new install has both the edited file AND the original file on their system. But, I do see dolby's point that the installer creates a "dirty system" by default.

Rather than fiddle with config files, we can simply modify the installer to use:
EDITOR="vi --cmd 'set nobackup'"
instead of
EDITOR="vi"

It's a simple enough fix. Hell, if we want to sate everyone, we could always add two menu options "vim with backup files" and "vim without backup files" or something more clear :)

Comment by Greg (dolby) - Thursday, 29 January 2009, 21:47 GMT
I didnt know setting the EDITOR like that was possible. That sounds great.
As far as the last part i dont get its point. I dont think anyone wants the backup files.
If i want to see how the original file looks like i usually go to /var/cache/pacman/pkg.
Comment by Aaron Griffin (phrakture) - Thursday, 29 January 2009, 22:12 GMT
re: "I don't thin anyone wants X" - that is quite a bold statement

I, for one, use vim's backup files all the time on some machines. While I don't know if I'd use them for configs like rc.conf, I *do* use them
Comment by Greg (dolby) - Thursday, 29 January 2009, 22:33 GMT
I dint mean noone wants backup files in general of course. Its obviously a handy feature. Not here though.
And if i may say so, if theres no backup files, noone is gonna complain, like its the case up til today.
If someone wanted to have those backup files there would be complaints even with the old vim config.
With backup files people already started griping. http://bugs.archlinux.org/task/12944#comment38214 :)
Comment by Aaron Griffin (phrakture) - Thursday, 29 January 2009, 22:51 GMT
  • Field changed: Due in Version (Undecided → 2009.08-alpha)
Good point - if no one has complained yet, it's not a big issue. We can adjust EDITOR for the next release.
Comment by Dieter Plaetinck (Dieter_be) - Friday, 30 January 2009, 08:54 GMT
Wait, we decided what now?
I suggest we provide 2 "editors" (vim with and without backup files) and steer uncertain users into the right direction with clever phrasing:
* nano (easier)
* vi with backup files
* vi without backup files (experienced users)
Comment by Greg (dolby) - Friday, 30 January 2009, 09:15 GMT
Absolutely unessesary IMO. Vi == experienced users
Also i dont think thats possible with the solution phrakture suggested?
Comment by Dieter Plaetinck (Dieter_be) - Friday, 30 January 2009, 09:31 GMT
Yes it's possible according to phrakture.
Little finetuned phrasing:
* nano (easy)
* vi with backup files (experienced users)
* vi without backup files (very experienced users)
Comment by Greg (dolby) - Friday, 30 January 2009, 09:44 GMT
No nano with backup files? (Very easy) :)
Comment by Aaron Griffin (phrakture) - Friday, 30 January 2009, 13:45 GMT
Naw, I think dolby is right - just nano and vi without backups.
Comment by Dieter Plaetinck (Dieter_be) - Friday, 30 January 2009, 14:10 GMT
and what's wrong with the 2 entries for vi?
Comment by Evangelos Foutras (foutrelis) - Friday, 30 January 2009, 14:21 GMT
If vi is selected, we could have a dialog pop up next, informing the user that backup files are created by default and asking them whether they want to disable this feature during the configuration step.
Comment by Greg (dolby) - Friday, 30 January 2009, 20:05 GMT
@Dieter: let me give you an example. Maybe a bit edge case but i wouldnt really know. Maybe its not that edge case. Anyway.
Lets say a new Arch user, but experienced in Linux, chooses vi to edit the files.
The installer gives him the capability of editing the files more than once. Hes clumsy sleepy or tired, so lets say he edited 5-6 of them, 5 times each.
How do you know think his /etc is gonna look like when he boots into the system? Its gonna be full of backups.
Comment by Dieter Plaetinck (Dieter_be) - Saturday, 31 January 2009, 10:14 GMT
Okay, but if that user chooses to use vi with backup files, then he knows he will have backup files. If doesn't want this, he could have picked the other entry.

I really don't see what's wrong with just having two options for vi. I think it's a clean, simple and efficient fix.
Comment by RicardoH (richer) - Friday, 06 February 2009, 04:31 GMT
I experienced this with the new RC1 installer and it surelly is a pain in the ... First thing i do is run a find command to search all the ~ files. How do i unset this option?
Comment by Aaron Griffin (phrakture) - Friday, 06 February 2009, 17:17 GMT
:set nobackup in your virc/vimrc
or remove "set backup" from the global virc/vimrc
Comment by Dieter Plaetinck (Dieter_be) - Friday, 06 February 2009, 17:30 GMT
Hey, can anyone explain me what's wrong with having 2 entries for vim? one with and one without backups?
Comment by Aaron Griffin (phrakture) - Friday, 06 February 2009, 17:40 GMT
@Dieter: Nothing really. It just might add too much complexity. Too many choices can sometimes be a hindrance. If it were up to me, I would use vim with no backups by default. This mirrors what nano does. If a user wants backups, they can always :set backup
Comment by Dieter Plaetinck (Dieter_be) - Friday, 06 February 2009, 17:45 GMT
If the default/"commonly accepted" behaviour of vim (on arch, but also upstream) is to not use backup files, then I'm with you.
If you're a vi user, you should know how your editor behaves and how to work with it. (and :set backup yourself if you want that)

so tell me, is no backups the default/"commonly accepted" behaviour for vi?
Comment by Aaron Griffin (phrakture) - Friday, 06 February 2009, 17:47 GMT
Hmmm good question. I know I usually shut it off, and have had my own vimrc for a LONG time, so I'm not sure of the default - obviously the previous default was no backups, and this has changed recently.
Comment by Greg (dolby) - Friday, 06 February 2009, 17:57 GMT
Yes, nobackup was an option in the default vimrc which was removed recently.
Does that change anything? Vim is not an editor whose purpose is to be used in installations.
Noone wants backups to be present in their fresh installation.
If you dont change it expect to see bug reports concerning this in the future cause people will not know about this.
They dont expect vim to behave that way.
Comment by Dieter Plaetinck (Dieter_be) - Friday, 06 February 2009, 18:21 GMT
> Yes, nobackup was an option in the default vimrc which was removed recently.
I mean more globally. "vim as it is widely known" as in "the behaviour people will expect, even (and especially) if they come from other distro's where they used vim and now install arch for the first time"

> Vim is not an editor whose purpose is to be used in installations.
an editor has the purpose of editing text files. where and what for the editing of text files is, it should not matter.

> Noone wants backups to be present in their fresh installation.
So you asked everyone? I for one like backup files...there are probably more people.
Comment by Greg (dolby) - Friday, 06 February 2009, 18:43 GMT
Vim had nobackup in the default config for as long as i can remember. I dont know what other people expect from vim.
As for the "So you asked everyone?" question.
3 people bothered to comment on this and they all said they dont want backups. I dont know what everyone else does or doesnt want cause noone else bothered to comment.
If all of what ive written above is not enough to convince you that its not the behaviour a user would expect, nor the developers would want from the installation i cant think of something that will.
This has nothing to do with staying vanilla or generalities like that. Theyre totally irrelevant here.
Maybe you could ask users in the mailing list to get more opinions if you think im the only one who doesnt want backups.
Comment by Aaron Griffin (phrakture) - Friday, 06 February 2009, 19:22 GMT
This one is getting a little out of hand guys. Let's take a step back - we're just talking about text files here. The ISO still installs, and everything works fine, there's just a few (what? 5 or 6) backup files left in /etc. It's not a huge deal.

However, and here's the important point, when someone installs an arch system, they expect a clean install. If a brand new install came with .pacnew and .pacsav files, would it bother you? It'd bother me!

I think we should look at it from that angle - we're talking about installing a clean system, and it's not clean.
Comment by Dieter Plaetinck (Dieter_be) - Saturday, 14 February 2009, 15:38 GMT
Well, it looks like keeping backups is the default behaviour.
quote /etc/virc:
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file
endif

My reasoning is that since keeping backups with vi is the default, this is what vi users expect. (but then again, since they are installing a system, one could also say they except a clean system).
-> If you keep backups, some users may complain about a dirty system
-> If you don't, some users may save a file with an error in it, realise it later, hope to find a backup file, but find out there is none.

What about this?
We leave backup files enabled, but at the end of the installation we do a rm $DESTDIR/etc/*~ ? That way we combine the advantages of both approaches and everybody is happy and we can live hand in hand in a world of rainbows and unicorns :)
Comment by Greg (dolby) - Saturday, 14 February 2009, 16:00 GMT
phrakture's solution is cleaner & better.
"Rather than fiddle with config files, we can simply modify the installer to use:
EDITOR="vi --cmd 'set nobackup'" instead of EDITOR="vi""
Also you say: "My reasoning is that since keeping backups with vi is the default, this is what vi users expect."
As a grub user i dont expect to find a graphical grub either. Why is that taken into consideration only for vi?
Anyway, the above was just to demonstrate that its not what users expect the deal here. Its about how you (the developers of the installer) want it to behave.
Comment by Dieter Plaetinck (Dieter_be) - Sunday, 08 March 2009, 16:54 GMT
Dolby, the grub issue you're referring to was a bug (that has been fixed).
I fixed it, so you can stop trolling now.

Loading...