darcs

Issue 2602 add command 'darcs config'

Title add command 'darcs config'
Priority feature Status unknown
Milestone Resolved in
Superseder Nosy List bf
Assigned To
Topics

Created on 2018-10-01.07:07:06 by bf, last changed 2018-10-01.07:07:06 by bf.

Messages
msg20346 (view) Author: bf Date: 2018-10-01.07:07:03
We should unify the several ways of configuring darcs with a single 
command 'darcs config'. This should work on the current repo unless we 
pass --global, which means edit the global (user) configuration. Standard 
action is to add a setting, with option --remove to instead remove it.

Syntax:

darcs config COMMAND OPTION
darcs config defaultrepo URL
darcs config email EMAIL -- badly named, better idea anyone?
darcs config author EMAIL
... any more? E.g. sources

and more generally

darcs config NAME VALUE

to replace environment variables (see below for details)

See also my comment on issue1898, part (b).

In principle, I would like to store configuration in a unified file 
format, but that would cause lots of compatibility problems. With 'darcs 
config' we could at least hide the several file formats that we currently 
use from the casual user.

Lastly, there are *way too many* environment variables that influence how 
darcs operates. Environment variables are a notoriously bad way to 
configure a user program. An exception to this rule are generic 
environment variables that the user can set to influence the behavior of 
many programs at once. This includes HOME, APPDATA, XDG_CACHE_HOME, 
EDITOR, PAGER, TMPDIR, EMAIL, and the various XYZ_PROXY variables. These 
should all be honored by default which is what we do now.

Everyting else, i.e mostly the variables that start with DARCS_ should be 
replaced into a new preference file format with a simple key=value 
syntax, or else scrapped because there is already a better way to 
configure them. In particular:

DARCS_EDITOR, DARCS_PAGER: preference, overrides standards env vars

DARCS_DONT_COLOR, DARCS_ALWAYS_COLOR, DARCS_ALTERNATIVE_COLOR, 
DARCS_DO_COLOR_LINES: ditto, but try to refactor

DARCS_DONT_ESCAPE_EXTRA,
DARCS_ESCAPE_EXTRA: i don't think anyone wants to configure the behavior 
at this fine level of granularity so I'd say remove them

DARCS_DONT_ESCAPE_TRAILING_CR: this should be decided depending on the OS 
we run on

DARCS_DONT_ESCAPE_ISPRINT: obsolete, scrap

DARCS_DONT_ESCAPE_TRAILING_SPACES,
DARCS_DONT_ESCAPE_ANYTHING,
DARCS_ESCAPE_8BIT: need to decide what to do about these, perhaps 
environment vars make a certain sense here for use in shell scripts

DARCS_TMPDIR: preference, overrides standard env var

DARCS_KEEP_TMPDIR: preference

DARCS_EMAIL: scrap, superseeded by global authors file
SENDMAIL: scrap, superseeded by defaults (i.e. use --sendmail-command 
CMD, we can give arguments to defaults since at least 2.12)

DARCS_SLOPPY_LOCKS: check if this is still needed

DARCS_SSH, DARCS_SCP, DARCS_SFTP: preferences

DARCS_PROXYUSERPWD: putting a password in plain text into an env var is a 
very bad idea IMO, should be removed

DARCS_CONNECTION_TIMEOUT: preferences (currently used only if built with 
-fcurl)
History
Date User Action Args
2018-10-01 07:07:06bfcreate