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

Re: Auto-subst of repository roots (was Re: svn diff branch woprking copy against mainline?)

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-11-03 04:59:02 CET

Daniel Berlin wrote:
> A bunch of my gcc users are complianing that they are continually typing
> the repository root to do certain diffs.
> They are, of course right.
> Usually, we just say "you can script with the shell", but as Richard
> points out below, a substitution works everywhere, shell only works if
> you are working in the same root everywhere.
>
> Ignoring the question of what character would substitute repository
> root, would anyone be opposed to having such a substitution.

Not sure. May I ask to see a couple of realistic use cases?

> For url vs url diffs, we'd look up the info from the current directory
> (best we can do).

So you mean something like: if the current directory is a Subversion WC then
get the repository from it; if not, fail. So, for example,

   svn diff --old=+/trunk/gcc/foo.c --new=+/branches/1.0.x/gcc/foo.c

meaning "diff the trunk and branch head versions of that file in the repository
for which the current working directory is a working copy". OK, perhaps.

> For url vs wc diff, one of the targets has to be in the wc, and we can
> just get the repository root for that file (in case it is switched).

So, for example,

   svn diff --old=+/trunk/gcc/foo.c --new=gcc/foo.c

meaning "diff gcc/foo.c against the trunk head version of that file in its
repository". That seems good. Note that in this example the "+" idea is only
needed if the current working copy is _not_ trunk, otherwise simply "diff
-rHEAD gcc/foo.c" would do the job.

> On Wed, 2005-11-02 at 16:08 -0800, Richard Henderson wrote:
>
>>On Wed, Nov 02, 2005 at 06:39:53PM -0500, Daniel Berlin wrote:
>>
>>>Of course, the question always raised when you try to do this is "why is
>>>this better than just using shell variables"
>>>
>>>if you can give me a good answer to take back to dev@subversion, i'm
>>>happy to
>>
>>If we had something to expand to "Repository Root", then you
>>would have a mechanism that would automatically work in whatever
>>repository you're currently working in. Something that can't be
>>said about shell variables.
>>
>>Even better if we can choose something that isn't already a shell
>>meta character, and so needs no quoting itself.
>>
>>What if we let "^[+]" substitute Repository Root? We'd get

Meaning a "+" character at the beginning of a target argument, I assume.

>> svn diff +/trunk/gcc/foo.c foo.c

That's not a realistic example:
   svn: Target lists to diff may not contain both working copy paths and URLs

This is where I'd be glad to see some realistic use cases, even if others feel
that this is worthwhile anyway. Use cases should state what the users are most
often trying to achieve, and what commands are currently required, and what
might the abbreviated commands look like.

Are my examples above the sort of thing you mean? If so, and a user is
commonly diffing between +/trunk/gcc and +/branches/1.0.x/gcc, then wouldn't
he/she prefer to substitute those with an environment variable or other method
of further abbreviation, thus obviating the need for abbreviation of just the
repository root? For example,

   svn diff --old=$GCC_TRUNK/foo.c --new=$GCC_1_0/foo.c

I'm not saying we shouldn't do the "+" thing, I'm just asking for more concrete
data.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 3 04:59:39 2005

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.