You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Hyrum K. Wright" <hy...@mail.utexas.edu> on 2010/12/20 22:28:35 UTC

Default commandline args

In issue #3765, I suggest the possibility of a CVS-style config file
wherein a user could specify a set of default arguments for a given
subcommand.  For example, 'svn diff' would default to 'svn diff -x -p'
if the config file had an entry for such.  Thinking this would be an
SMOP, I jumped in...only to discover that it isn't.

The actual implementation isn't hard, I'm just wondering about where
the configuration should live.  We have a ~/.subversion/config file,
but these options aren't for the client library, they are specific to
the commandline client.  This makes me think that we should have a
separate file for the commandline client, and that it may want to be
something like ~/.svnrc or something equally commandline-ish.

Thoughts?

-Hyrum

http://subversion.tigris.org/issues/show_bug.cgi?id=3765

Re: Default commandline args

Posted by Stefan Fuhrmann <eq...@web.de>.
On 20.12.2010 23:28, Hyrum K. Wright wrote:
> In issue #3765, I suggest the possibility of a CVS-style config file
> wherein a user could specify a set of default arguments for a given
> subcommand.  For example, 'svn diff' would default to 'svn diff -x -p'
> if the config file had an entry for such.  Thinking this would be an
> SMOP, I jumped in...only to discover that it isn't.
>
> The actual implementation isn't hard, I'm just wondering about where
> the configuration should live.  We have a ~/.subversion/config file,
> but these options aren't for the client library, they are specific to
> the commandline client.  This makes me think that we should have a
> separate file for the commandline client, and that it may want to be
> something like ~/.svnrc or something equally commandline-ish.
>
> Thoughts?
>
> -Hyrum
>
> http://subversion.tigris.org/issues/show_bug.cgi?id=3765
I think this kind of feature can be useful and since
it is a UI optimization specific / local to a particular
client, I don't see why it should not be implemented.

TSVN, for instance, uses its own implementation
to manage user preferences and these are often
quite specific to TSVN's UI needs. So, there is
little room for or potential benefit of reuse across
various client implementations.

Not to limit the kind of information a particular
client could store in its config file (e.g. multiple
sections per client instead of one), I would prefer
separate config files for each client.

The number of clients would be > 1 and I would
not like to see my home folder being cluttered by
tons of .svnrc, .svnadminrc ... files. Keep them in
~/.subversion/ .

-- Stefan^2.

Re: Default commandline args

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Tue, Dec 21, 2010 at 12:34 AM, Blair Zajac <bl...@orcaware.com> wrote:
> On 12/20/10 8:30 PM, C. Michael Pilato wrote:
>>
>> On 12/20/2010 05:28 PM, Hyrum K. Wright wrote:
>>>
>>> In issue #3765, I suggest the possibility of a CVS-style config file
>>> wherein a user could specify a set of default arguments for a given
>>> subcommand.  For example, 'svn diff' would default to 'svn diff -x -p'
>>> if the config file had an entry for such.  Thinking this would be an
>>> SMOP, I jumped in...only to discover that it isn't.
>>>
>>> The actual implementation isn't hard, I'm just wondering about where
>>> the configuration should live.  We have a ~/.subversion/config file,
>>> but these options aren't for the client library, they are specific to
>>> the commandline client.  This makes me think that we should have a
>>> separate file for the commandline client, and that it may want to be
>>> something like ~/.svnrc or something equally commandline-ish.
>>
>> ~/.svnrc makes perfect sense to me (with /etc/svnrc as a system-wide
>> default, if you wanna roll that way).
>
> What about ~/.subversion/cli or ~/.subversion/command-line-client.  If
> somebody wants to copy an existing configuration from another user, they
> just can't copy ~/.subversion now.

There a chicken-and-egg problem with using ~/.subversion (and it's
other-platform equivalents).  We have a commandline arg which allows a
user to specify, at runtime, the configuration directory to use.  In
order to see this arg, we have to parse the comandline arguments.  It
becomes rather more convoluted if we parse some of the arguments to
determine the config directory, and then add more arguments *based* on
that config directory.

Also, I agree with the other point that everything in ~/.subversion is
libsvn_client (or lower), and since this is strictly a commandline
client feature, it should go in a separate location.

-Hyrum

Re: Default commandline args

Posted by Branko Čibej <br...@xbc.nu>.
On 21.12.2010 08:31, Stefan Sperling wrote:
> The svnrc file should not be created by libsvn_client, though.
> The cli client could create it after initializing the client library,
> at which point the config directory is guaranteed to exist (if I remember
> correctly).

Indeed, the proposed "default command-line arguments" have nothing
whatsoever to do with libsvn_client, they're handled entirely within
svn/main.c.

-- Brane

Re: Default commandline args

Posted by Stefan Sperling <st...@elego.de>.
On Mon, Dec 20, 2010 at 10:34:46PM -0800, Blair Zajac wrote:
> What about ~/.subversion/cli or ~/.subversion/command-line-client.
> If somebody wants to copy an existing configuration from another
> user, they just can't copy ~/.subversion now.

There are other clients such as TortoiseSVN which have some config
settings outside of ~/.subversion. Users if those clients cannot
just copy ~/.subversion either.

But I suppose the CLI client is the "default" client we support.
So I don't see an issue with having its configuration live within
~/.subversion.  FWIW, I'd prefer the name "~/.subversion/svnrc".

The svnrc file should not be created by libsvn_client, though.
The cli client could create it after initializing the client library,
at which point the config directory is guaranteed to exist (if I remember
correctly).

Stefan

Re: Default commandline args

Posted by Blair Zajac <bl...@orcaware.com>.
On 12/20/10 8:30 PM, C. Michael Pilato wrote:
> On 12/20/2010 05:28 PM, Hyrum K. Wright wrote:
>> In issue #3765, I suggest the possibility of a CVS-style config file
>> wherein a user could specify a set of default arguments for a given
>> subcommand.  For example, 'svn diff' would default to 'svn diff -x -p'
>> if the config file had an entry for such.  Thinking this would be an
>> SMOP, I jumped in...only to discover that it isn't.
>>
>> The actual implementation isn't hard, I'm just wondering about where
>> the configuration should live.  We have a ~/.subversion/config file,
>> but these options aren't for the client library, they are specific to
>> the commandline client.  This makes me think that we should have a
>> separate file for the commandline client, and that it may want to be
>> something like ~/.svnrc or something equally commandline-ish.
>
> ~/.svnrc makes perfect sense to me (with /etc/svnrc as a system-wide
> default, if you wanna roll that way).

What about ~/.subversion/cli or ~/.subversion/command-line-client.  If somebody 
wants to copy an existing configuration from another user, they just can't copy 
~/.subversion now.

Blair

Re: Default commandline args

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 12/20/2010 05:28 PM, Hyrum K. Wright wrote:
> In issue #3765, I suggest the possibility of a CVS-style config file
> wherein a user could specify a set of default arguments for a given
> subcommand.  For example, 'svn diff' would default to 'svn diff -x -p'
> if the config file had an entry for such.  Thinking this would be an
> SMOP, I jumped in...only to discover that it isn't.
> 
> The actual implementation isn't hard, I'm just wondering about where
> the configuration should live.  We have a ~/.subversion/config file,
> but these options aren't for the client library, they are specific to
> the commandline client.  This makes me think that we should have a
> separate file for the commandline client, and that it may want to be
> something like ~/.svnrc or something equally commandline-ish.

~/.svnrc makes perfect sense to me (with /etc/svnrc as a system-wide
default, if you wanna roll that way).

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Re: Default commandline args

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Bert Huijben wrote on Tue, Dec 21, 2010 at 10:00:37 +0100:
> > -----Original Message-----
> > From: hyrum@hyrumwright.org [mailto:hyrum@hyrumwright.org] On Behalf Of
> > Hyrum K. Wright
> > Sent: maandag 20 december 2010 23:29
> > To: Subversion Development
> > Subject: Default commandline args
> > 
> > In issue #3765, I suggest the possibility of a CVS-style config file
> > wherein a user could specify a set of default arguments for a given
> > subcommand.  For example, 'svn diff' would default to 'svn diff -x -p'
> > if the config file had an entry for such.  Thinking this would be an
> > SMOP, I jumped in...only to discover that it isn't.
> > 
> > The actual implementation isn't hard, I'm just wondering about where
> > the configuration should live.  We have a ~/.subversion/config file,
> > but these options aren't for the client library, they are specific to
> > the commandline client.  This makes me think that we should have a
> > separate file for the commandline client, and that it may want to be
> > something like ~/.svnrc or something equally commandline-ish.
> 

How about having ~/.subversion/clients/${client_name}/

and then svn/main.c just calls svn_config_bikeshed(client_name='cmdline').

> I remember reading (from some far earlier discussions) that we had specific
> reasons not to implement these options here. (Deliberate decision against
> the CVS design)
> 
> One reason I could think of (without looking at those discussions) is that
> it would break shell scripts that just use 'svn <some options>'.
> (Especially if someone would add a -u to status, like one of the examples)
> 

Agreed that we should have an option to override the default --- e.g.,
to force 'status' to run without -u.

> Another reason might be that 'svn <options>' works differently on one system
> then on another one when the config file changes, but I don't think this a
> strong argument as we already change output in some cases. (E.g. diff
> options)
> 
> 
> But as long as the options are in the svn client, easy to override and not
> (by default) used from plain libsvn_client, I don't have a strong opinion
> for or against this.
> 
> 
> 	Bert
> 

Re: Default commandline args

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Bert Huijben wrote on Tue, Dec 21, 2010 at 10:00:37 +0100:
> > -----Original Message-----
> > From: hyrum@hyrumwright.org [mailto:hyrum@hyrumwright.org] On Behalf Of
> > Hyrum K. Wright
> > Sent: maandag 20 december 2010 23:29
> > To: Subversion Development
> > Subject: Default commandline args
> > 
> > In issue #3765, I suggest the possibility of a CVS-style config file
> > wherein a user could specify a set of default arguments for a given
> > subcommand.  For example, 'svn diff' would default to 'svn diff -x -p'
> > if the config file had an entry for such.  Thinking this would be an
> > SMOP, I jumped in...only to discover that it isn't.
> > 
> > The actual implementation isn't hard, I'm just wondering about where
> > the configuration should live.  We have a ~/.subversion/config file,
> > but these options aren't for the client library, they are specific to
> > the commandline client.  This makes me think that we should have a
> > separate file for the commandline client, and that it may want to be
> > something like ~/.svnrc or something equally commandline-ish.
> 

How about having ~/.subversion/clients/${client_name}/

and then svn/main.c just calls svn_config_bikeshed(client_name='cmdline').

> I remember reading (from some far earlier discussions) that we had specific
> reasons not to implement these options here. (Deliberate decision against
> the CVS design)
> 
> One reason I could think of (without looking at those discussions) is that
> it would break shell scripts that just use 'svn <some options>'.
> (Especially if someone would add a -u to status, like one of the examples)
> 

Agreed that we should have an option to override the default --- e.g.,
to force 'status' to run without -u.

> Another reason might be that 'svn <options>' works differently on one system
> then on another one when the config file changes, but I don't think this a
> strong argument as we already change output in some cases. (E.g. diff
> options)
> 
> 
> But as long as the options are in the svn client, easy to override and not
> (by default) used from plain libsvn_client, I don't have a strong opinion
> for or against this.
> 
> 
> 	Bert
> 

RE: Default commandline args

Posted by Bert Huijben <be...@qqmail.nl>.
> -----Original Message-----
> From: hyrum@hyrumwright.org [mailto:hyrum@hyrumwright.org] On Behalf Of
> Hyrum K. Wright
> Sent: maandag 20 december 2010 23:29
> To: Subversion Development
> Subject: Default commandline args
> 
> In issue #3765, I suggest the possibility of a CVS-style config file
> wherein a user could specify a set of default arguments for a given
> subcommand.  For example, 'svn diff' would default to 'svn diff -x -p'
> if the config file had an entry for such.  Thinking this would be an
> SMOP, I jumped in...only to discover that it isn't.
> 
> The actual implementation isn't hard, I'm just wondering about where
> the configuration should live.  We have a ~/.subversion/config file,
> but these options aren't for the client library, they are specific to
> the commandline client.  This makes me think that we should have a
> separate file for the commandline client, and that it may want to be
> something like ~/.svnrc or something equally commandline-ish.

I remember reading (from some far earlier discussions) that we had specific
reasons not to implement these options here. (Deliberate decision against
the CVS design)

One reason I could think of (without looking at those discussions) is that
it would break shell scripts that just use 'svn <some options>'.
(Especially if someone would add a -u to status, like one of the examples)

Another reason might be that 'svn <options>' works differently on one system
then on another one when the config file changes, but I don't think this a
strong argument as we already change output in some cases. (E.g. diff
options)


But as long as the options are in the svn client, easy to override and not
(by default) used from plain libsvn_client, I don't have a strong opinion
for or against this.


	Bert