From: Jason W. <ja...@ja...> - 2017-10-26 18:10:57
|
Hi Vladimir, I'm no expert, but I think that this is the standard way to update/replace a file. The trouble with modifying a file in-place is that if the machine crashes while you're partway through editing the file, then the file is corrupted. Whereas, when you create a separate file and then unlink/rename/swap them, you always have a valid file on your hard drive. That said... there's certainly ways to get the best of both (the atomic replace and the symbolic link thing.) eg vim handles this well. I suggest as a workaround that you move the whole ~/.cmus directory into your git folder, and symlink that: eg: mv ~/.cmus ~/my_gits/config/cmus ln -s my_gits/config/cmus ~/.cmus My ~/.cmus on my computers is a symbolic link, which enables me to have different cmus settings/playlists/etc on my different computers and still track the settings files with ~/.git -- Jason > Hello everyone, > > I noticed something strange with cmus today. > I wanted to put my cmus configuration in my github 'config' repo so > that I always have the same configuration on all my machines but I > found out that when cmus saves its configuration (in the > ~/.cmus/autosave file) it deletes the symbolic link that points to > the git repo and creates a regular file in its place. Is this the > desired behavior? Wouldn't it be better if cmus honors the link and > overrides its contents instead of recreating the file (at least on > Linux, although I find that some programs work well with [1]this > too)? > I still have my config in github but when I make changes to the > config I need to copy the file ... ; ) > > ➜ v % cmus --version > cmus v2.7.0 > Copyright 2004-2006 Timo Hirvonen > Copyright 2008-2013 Various Authors > (the one shipped with Debian 9) > > Thanks, > Vladimir > > References > > 1. http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html |