Philipp Benner wrote:
>> I keep my home directory in version control, as a means of sharing it
>> across systems, keeping it backed up, and tracking changes to it.  One
>> of the biggest problems I run into relates to applications that always
>> write out their entire preferences, rather than only changed
>> preferences.  This makes it much harder to track changes and share
>> files across machines.  Could transmission please write out only its
>> changed preferences, rather than all preferences?
> 
> I don't see the point here why it is necessary to only write changes. A
> good revision control system should recognize what changed anyway. I
> just tested it with git. After commiting all files in ~/.transmission I
> changed one option:
> $ git diff                         
> diff --git a/gtk/prefs.ini b/gtk/prefs.ini
> index b733d78..7f023f0 100644
> --- a/gtk/prefs.ini
> +++ b/gtk/prefs.ini
> @@ -4,7 +4,7 @@ download-limit-enabled=false
>  download-limit=100
>  upload-limit-enabled=true
>  upload-limit=50
> -prompt-for-download-directory=false
> +prompt-for-download-directory=true
>  default-download-directory=/home/philipp/tmp
>  listening-port=9090
>  nat-traversal-enabled=true
> 
> As you see, the diff shows only the one option that I changed. Anyway, it
> is _much_ easier to write the whole preferences file. At the moment I tend
> to close this bug if you don't have any objections.

The problems with writing out all preferences do not arise in that
simple case; you only had one version of transmission and one machine.
To elaborate on the problems I've encountered with other applications
that write out all preferences:

* If I have two different versions of the application on two different
  machines, each will want to write out its entire set of preferences,
  which may differ.  Thus, the file will become changed on all
  machines not running the same version as the one which generated the
  file I checked in.  Furthermore, if the new version writes out new
  preferences and the old version does not ignore preferences it does
  not understand, this could lead to breakage.

* Similarly, sometimes GUI applications write out their preferences in
  inconsistent orders, and these orders may change between versions.
  (This may or may not apply to transmission, depending on what future
  versions do.)

* A new version may change the default for a preference.  If you write
  out only changed preferences, then you allow a distinction between
  preferences the user specifically wanted a certain way and
  preferences the user left at the default, and can decide to update
  only the latter to new defaults; this avoids overriding a user's
  desired configuration.

* Preferences like default-download-directory contain my home
  directory path.  On all my personal machines I have the username
  "josh", but on some other machines I have different usernames, or
  occasionally non-standard home directory paths.  If transmission
  avoided writing this preference out unless I change it, I could
  leave it at the default of my home directory.  (As another solution,
  transmission could abbreviate my home directory to ~, and expand
  that when reading in the file.)

* Some applications automatically change preferences based on system
  configuration and available features.  For example, what if
  transmission decided to turn off the system tray icon when I run it
  in an environment that has no system tray (such as a minimalistic
  window manager)?  It should not write out this preference, because I
  did not explicitly change it.

* Some applications record their window position and size, even if
  explicitly told not to *use* the last window position and size.
  Fortunately transmission does not do this (yet).

- Josh Triplett

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to