[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn patch --strip-count=N or svn patch --strip=N?

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 25 Oct 2010 16:13:58 +0200

On Mon, Oct 25, 2010 at 09:50:41AM -0400, C. Michael Pilato wrote:
> On 10/25/2010 09:39 AM, Stefan Sperling wrote:
> > On Mon, Oct 25, 2010 at 01:16:29PM +0100, Julian Foad wrote:
> >> Do we need both "--strip-count" and "--strip" as aliases? I think
> >> "--strip" is sufficient; the word "count" doesn't add much. "--strip"
> >> matches GNU patch. Fewer aliases -> better.
> >
> > The word "count" adds something when you're looking at all options
> > in isolation of their subcommands (option names are global).
>
> I agree, to a point. It's not as if we display the --strip-count option
> anywhere except in the usage message of the one context where it is valid,
> though.
>
> > The --strip-count name matches the variable name in the code.
>
> Er... This is a non-reason. :-)

It's not a non-reason because there is no good reason for not naming
things in a consistent way.

Consistency between the API and the CLI interface is good.
It's not terribly important, but consistency in naming things does make
a difference if you try to follow a code path from the very top (CLI
client) to the very bottom of Subversion (e.g. libsvn_wc).
Any inconsistency your encounter during that journey presents a mental
hoop you need to jump through in order to continue the journey.

> I don't think it's so terribly important to match the 'patch' command's
> option name with our option's primary name, but it's a nice-to-have
> achievable via the option aliases. If we're going to go that route, though,
> then we should choose an option's primary name as if there was nothing else
> to model after. I mean, is --strip-count as descriptive as it can be, or
> would something else serve better? --strip-components-count?
> --ignore-path-components-count?

The need for such long names originates from the fact that options in
Subversion are global, rather than specific to a subcommand.
Because option names by themselves aren't tied to a context it's hard to
predict whether some other subcommand might want to use the same or a
similarly named option some day.

Anyway, let's keep aliases as short-hands for interactive use, rather
than as alternative long-option names. I'm fine with renaming
--strip-count to --strip and aliasing it to --st. Or maybe not even
bother with aliasing it since --strip is reasonably short anyway.

Stefan
Received on 2010-10-25 16:14:53 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.