Issue 1897 changepref p x -> x should be a noop.

Title changepref p x -> x should be a noop.
Priority feature Status needs-implementation
Milestone Resolved in
Superseder Nosy List dmitry.kurochkin, jaredj, kowey, twb
Assigned To

Created on 2010-07-22.06:19:39 by twb, last changed 2011-08-12.13:24:11 by kowey.

msg11816 (view) Author: twb Date: 2010-07-22.06:19:38
Consider the following patch:

    root@dali:/etc# darcs cha --max=1 -v
    Thu Jul 22 13:29:46 EST 2010  twb
      * committing changes in /etc after apt run

      Package changes:
      -etckeeper 0.47
      +etckeeper 0.48
        hunk ./.darcsignore 3
        hunk ./.darcsignore 5
        hunk ./.etckeeper 709
        +maybe chmod 755 './etckeeper/vcs.d/50vcs-cmd'
        hunk ./etckeeper/commit.d/50vcs-commit 52
        -   if [ -n "$HGUSER" ]; then
        +   if [ -z "$HGUSER" ]; then
        adddir ./etckeeper/vcs.d
        addfile ./etckeeper/vcs.d/50vcs-cmd
        hunk ./etckeeper/vcs.d/50vcs-cmd 1
        +set -e
        +# check whether we can locate the vcs binary
        +if [ -n "$VCS" ] && which "$VCS" > /dev/null; then
        +        # pass commands to the VCS application
        +        $VCS "$@"
        +   echo "error: VCS ($VCS) not set or not in PATH" >&2
        +   exit 1
        changepref boringfile

At the bottom, you can see that darcs has dutifully recorded a no-op
change of the boringfile preference.  This is because etckeeper
assumes that "darcs setpref boringfile .darcsignore" is idempotent,
and runs it every time etckeeper is upgraded.

I wish a changepref to the current value didn't get recorded.
msg11827 (view) Author: kowey Date: 2010-07-22.15:56:43
I guess it's fair enough that darcs relies on the value of 
_darcs/prefs/prefs just like it relies on the value of the pristine state 
for changepref.

The whole preferences system is a bit flaky and could use an overhaul.
Date User Action Args
2010-07-22 06:19:39twbcreate
2010-07-22 15:56:45koweysetstatus: unknown -> needs-implementation
priority: feature
title: changepref x y -> y should be a noop. -> changepref p x -> x should be a noop.
nosy: + kowey, jaredj
messages: + msg11827
topic: + ProbablyEasy
2011-08-12 13:24:11koweysettopic: - ProbablyEasy