.darcs vs env (was Re: [darcs-users] Re: Pipes, pagers and pretty colors)
Michael G Schwern
schwern at pobox.com
Mon Apr 4 16:18:29 UTC 2005
On Mon, Apr 04, 2005 at 07:42:42AM -0400, David Roundy wrote:
> > Environment variable? Isn't there ~/.darcs for global config?
>
> All ~/.darcs/ currently supports is defaults (which specifies default
> command line flags) and boring and binaries. I'm not sure whether ~/.darcs
> even works on windows, but I seem to recall hearing that environment
> variables do.
They do. Which means $HOME can be defined which means ~/.darcs can be
found. $HOME usually is not defined. However, since you're going to have
people defining environment variables anyway... you might as well have them
define $HOME, stick .darcs into that directory and edit that. At least
setting $HOME is useful for something other than darcs. And I think in
Windows in order for environment variables to be propegated you might
have to relog back in.
Of course then you might run into the problem of the Explorer whining that
you can't create a file named .darcs. Ugg. But Notepad will happily do it.
> We could also look for "environment variables" in a file in
> ~/.darcs, but I don't see that it has a great advantage over environment
> variables... except that I suppose one could argue that environment
> variables clutter up one's environment.
I'll argue that environment variables clutter up one's environment. :)
But that's not really the problem.
I'll argue that its a more archane way of doing things. One of the biggest
hurdles in setting up CVS was always "now set your CVS_RSH and CVSROOT
environment variables". A lot of casual Unix users don't know how to do
that permanently (ie. editing .bashrc or maybe its .profile or maybe
.bash_profile or maybe .cshrc or perhaps .tcshrc and is it export VAR or
set VAR). While some may argue that this is something a Unix user should
have learned already, in my experience you can go a looooooong time without
having to set an environment variable.
Finally, it just seems silly that when you have a perfectly good user
configuration file to continue to do some user configuration using
environment variables. Now configuration is split between environment
variables and the config file, which bit goes where?
If nothing else keeping the configuration information all in one place
makes it easier to move from machine to machine, account to account. Just
copy the .darcs file and you're configured to your liking and ready to go.
So yes, one should be able to set darcs variables inside the config file.
More information about the darcs-users
mailing list