You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Blair Zajac <bl...@orcaware.com> on 2008/04/22 15:44:23 UTC

Single file externals plan

I'm working on extending svn:externals to allow single files to be  
placed into a working copy, not just directories.

Here's my current thinking on behavior and implementation.

- Support only intra-repository file externals.  This will allow the  
svn client to effectively do a 'touch foo; svn add foo; svn switch URL  
foo' to have a external in the wc (those actual commands only work in  
a 1.5 client).  So unlike a directory external, the .svn/entries file  
has entries for file externals.  This is needed for supporting all the  
client commands on a file.  I don't see modifying the existing  
directory behavior.

- The working copy gets an additional flag for each entry indicating  
if the file is an external.  This allows the svn:externals to place an  
external file in a subdirectory of the directory that has the  
svn:externals property so the subdirectory doesn't have to check any  
externals when interacting with the file.  If we didn't have this, I  
think file externals would only work in the directory with the  
svn:externals feature.

- Commit behavior:
   - A conflict on a external file prevents a commit just as if the  
working copy had a non-external file conflict.
   - However, the commit does not send any modifications on the file  
external to the server, just as if the external was a directory  
external.
   Presumably a conflict in a file external indicates breakage that  
should be fixed to allow a commit to go through.  However, like our  
policy with directory externals, we shouldn't commit it implicitly.

- The status command will check if a file is an external and print  
using a lowercase 'x', so people can distinguish between a directory  
and file external.

- Change the text shown during checkout or update
     Fetching external item into 'foobar'
   to
     Fetching external item into directory 'foobar'
   or

     Fetching external item into file 'foobar'

This doesn't look too hard, probably a large amount of edge cases.  Am  
I missing anything?  Will merge info for the switched file just work?

Regards,
Blair

-- 
Blair Zajac, Ph.D.
CTO, OrcaWare Technologies
<bl...@orcaware.com>
Subversion training, consulting and support
http://www.orcaware.com/svn/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Single file externals plan

Posted by Sander Striker <s....@striker.nl>.
On Tue, Apr 22, 2008 at 8:18 PM, Karl Fogel <kf...@red-bean.com> wrote:
> Blair Zajac <bl...@orcaware.com> writes:
>  > Here's my current thinking on behavior and implementation.
>  >
>  > - Support only intra-repository file externals.  This will allow the
>  > svn client to effectively do a 'touch foo; svn add foo; svn switch URL
>  > foo' to have a external in the wc (those actual commands only work in
>  > a 1.5 client).  So unlike a directory external, the .svn/entries file
>  > has entries for file externals.  This is needed for supporting all the
>  > client commands on a file.  I don't see modifying the existing
>  > directory behavior.
>
>  Before implementing this, it might be good to find out how often people
>  use intra-repository externals at all.  My guess (uneducated, anecdotal,
>  etc) is: not much.  Certainly most of the externals I set are coming
>  from other repositories...

I think you'll find it is used more intra-repository than you'd expect.

Sander

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: Single file externals plan

Posted by Damian Powell <da...@shadow-angel.com>.
> I'd use it.

We'd use it at our company too. We currently use intra-repo externals to
include config files. We fake single file externals though by having each
file in its own directory.

While you're looking at externals, here's a question: would it be possible
to commit changes to externals within the same transaction as the the commit
to the parent directory? Obviously this would only be possible intra-repo
but I think it's valid. It would also make sense to *not* do this by
default, but rather, have an option on 'svn commit' that allows it.

Here's my reasoning for this feature: we use externals as a convenient way
to compose a working copy. We use it to pull code for our shared libraries
and customised third-party libraries into a regular structure. We then
merrily go about editing for a work item which may touch shared libraries,
as well as standard project code. It would be useful then, to do recursive
commits (intra-repo) in the same transaction, much as Subversion can do
recursive updates (where there is an option to EXclude externals).

The atomicity of commits is one of the big features of SVN that was missing
in other VCSs in SVN's price range. ;) It's a shame that externals breaks
that feature.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Single file externals plan

Posted by Karl Fogel <kf...@red-bean.com>.
Alan Barrett <ap...@cequrux.com> writes:
> On Tue, 22 Apr 2008, Karl Fogel wrote:
>> > - Support only intra-repository file externals.
>> Before implementing this, it might be good to find out how often people
>> use intra-repository externals at all.
>
> I'd use it.  I'd let hosts/foo/etc/somefile.cfg and
> hosts/bar/etc/somefile.cfg both be external references to
> common/etc/somefile.cfg.

Seems my speculation was off, judging from responses so far :-).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Single file externals plan

Posted by Alan Barrett <ap...@cequrux.com>.
On Tue, 22 Apr 2008, Karl Fogel wrote:
> > - Support only intra-repository file externals.
> Before implementing this, it might be good to find out how often people
> use intra-repository externals at all.

I'd use it.  I'd let hosts/foo/etc/somefile.cfg and
hosts/bar/etc/somefile.cfg both be external references to
common/etc/somefile.cfg.

--apb (Alan Barrett)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Single file externals plan

Posted by Karl Fogel <kf...@red-bean.com>.
Blair Zajac <bl...@orcaware.com> writes:
> Unlike directory externals, I would think file externals will mostly
> be intra-repository, such as you want to pull some config file.  I
> can't think of too many single-files you would want to pull from a
> foreign repository. Anything more than a file or two you'd probably
> want to use a directory external and then put symlinks pointing to the
> external files.

Hunh.  I guess I just don't know the use cases (a matter of my
ignorance, not a problem in the proposal).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Single file externals plan

Posted by Blair Zajac <bl...@orcaware.com>.
Karl Fogel wrote:
> Blair Zajac <bl...@orcaware.com> writes:
>> Here's my current thinking on behavior and implementation.
>>
>> - Support only intra-repository file externals.  This will allow the
>> svn client to effectively do a 'touch foo; svn add foo; svn switch URL
>> foo' to have a external in the wc (those actual commands only work in
>> a 1.5 client).  So unlike a directory external, the .svn/entries file
>> has entries for file externals.  This is needed for supporting all the
>> client commands on a file.  I don't see modifying the existing
>> directory behavior.
> 
> Before implementing this, it might be good to find out how often people
> use intra-repository externals at all.  My guess (uneducated, anecdotal,
> etc) is: not much.  Certainly most of the externals I set are coming
> from other repositories...

Unlike directory externals, I would think file externals will mostly be 
intra-repository, such as you want to pull some config file.  I can't think of 
too many single-files you would want to pull from a foreign repository. 
Anything more than a file or two you'd probably want to use a directory external 
and then put symlinks pointing to the external files.

Blair

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Single file externals plan

Posted by Nathan Yospe <ny...@gmail.com>.
On Tue, Apr 22, 2008 at 11:18 AM, Karl Fogel <kf...@red-bean.com> wrote:
> Blair Zajac <bl...@orcaware.com> writes:
>  > Here's my current thinking on behavior and implementation.

>  > - Support only intra-repository file externals.  This will allow the
>  > svn client to effectively do a 'touch foo; svn add foo; svn switch URL
>  > foo' to have a external in the wc (those actual commands only work in
>  > a 1.5 client).  So unlike a directory external, the .svn/entries file
>  > has entries for file externals.  This is needed for supporting all the
>  > client commands on a file.  I don't see modifying the existing
>  > directory behavior.

>  Before implementing this, it might be good to find out how often people
>  use intra-repository externals at all.  My guess (uneducated, anecdotal,
>  etc) is: not much.  Certainly most of the externals I set are coming
>  from other repositories...

Single platform aliased views of a massive cross-platform repository.

This would make it much easier to have a checkout of (for example) a path
"branches/../root/cpp-aix/" that aliased only those portions of
"branches/../root/cpp/" that were relevant to building on aix.

I could use this to pull the cross-platform portions of the makefiles to the
right place in the tree.

Regards,
Nathan F. Yospe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Single file externals plan

Posted by Blair Zajac <bl...@orcaware.com>.
Nico Schellingerhout wrote:
> "Geoff Rowell" <Ge...@varolii.com> wrote on 04/23/2008 03:08:24 PM:
> 
> Is there are a pressing reason to limit these links to
> intra-repository only?

An easier implementation.

Blair


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: Re: Single file externals plan

Posted by Nico Schellingerhout <ni...@philips.com>.
"Geoff Rowell" <Ge...@varolii.com> wrote on 04/23/2008 03:08:24 PM:

> On Tuesday, April 22, 2008 2:18 PM Karl Fogel wrote:
> >Blair Zajac <bl...@orcaware.com> writes:
> >> Here's my current thinking on behavior and implementation.
> >>
> >> - Support only intra-repository file externals.  This will allow the
> >> svn client to effectively do a 'touch foo; svn add foo; svn switch
> URL
> >> foo' to have a external in the wc (those actual commands only work in
> >> a 1.5 client).  So unlike a directory external, the .svn/entries file
> >> has entries for file externals.  This is needed for supporting all
> the
> >> client commands on a file.  I don't see modifying the existing
> >> directory behavior.
> >
> > Before implementing this, it might be good to find out how often
> people
> > use intra-repository externals at all.  My guess (uneducated,
> anecdotal,
> > etc) is: not much.  Certainly most of the externals I set are coming
> > from other repositories...
>
> I believe that this depends upon your repository project layout. Those
> who utilize the multiple projects in a single repository layout will
> tend
> to have intra-repository externals. Others who utilize the single
> project
> in multiple repositories layout will tend to have inter-repository
> externals.
>
> Overall, most of us probably have a mixed layout.

Indeed. Single-file link support has been on our wish list for
some time, but we have use for inter- as well as intra-repo
links. That would simplify some of our more involved repo layouts
significantly.

Is there are a pressing reason to limit these links to
intra-repository only?

- Nico

RE: Re: Single file externals plan

Posted by Geoff Rowell <Ge...@varolii.com>.
On Tuesday, April 22, 2008 2:18 PM Karl Fogel wrote:
>Blair Zajac <bl...@orcaware.com> writes:
>> Here's my current thinking on behavior and implementation.
>>
>> - Support only intra-repository file externals.  This will allow the
>> svn client to effectively do a 'touch foo; svn add foo; svn switch
URL
>> foo' to have a external in the wc (those actual commands only work in
>> a 1.5 client).  So unlike a directory external, the .svn/entries file
>> has entries for file externals.  This is needed for supporting all
the
>> client commands on a file.  I don't see modifying the existing
>> directory behavior.
>
> Before implementing this, it might be good to find out how often
people
> use intra-repository externals at all.  My guess (uneducated,
anecdotal,
> etc) is: not much.  Certainly most of the externals I set are coming
> from other repositories...

I believe that this depends upon your repository project layout. Those
who utilize the multiple projects in a single repository layout will
tend
to have intra-repository externals. Others who utilize the single
project
in multiple repositories layout will tend to have inter-repository
externals.

Overall, most of us probably have a mixed layout.

-Geoff


This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Single file externals plan

Posted by Steinar Bang <sb...@dod.no>.
>>>>> Karl Fogel <kf...@red-bean.com>:

> Before implementing this, it might be good to find out how often
> people use intra-repository externals at all.  My guess (uneducated,
> anecdotal, etc) is: not much.  Certainly most of the externals I set
> are coming from other repositories...

The only externals I've ever used, was intra-repository.  I used them as
a "symlink", to map the same part into different projects (a common set
of makefiles and XSL style sheet for several DocBook XML documents).

And it annoyed me that I had to specify the externals with a full path,
because that would break, if I eg. moved the repo to a different server.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Single file externals plan

Posted by Wascally Wabbit <wa...@earthling.net>.
Karl Fogel wrote:
> Blair Zajac <bl...@orcaware.com> writes:
>> Here's my current thinking on behavior and implementation.
>>
>> - Support only intra-repository file externals.  This will allow the
>> svn client to effectively do a 'touch foo; svn add foo; svn switch URL
>> foo' to have a external in the wc (those actual commands only work in
>> a 1.5 client).  So unlike a directory external, the .svn/entries file
>> has entries for file externals.  This is needed for supporting all the
>> client commands on a file.  I don't see modifying the existing
>> directory behavior.
> 
> Before implementing this, it might be good to find out how often people
> use intra-repository externals at all.  My guess (uneducated, anecdotal,
> etc) is: not much.  Certainly most of the externals I set are coming
> from other repositories...
> 
> -Karl

Couple of my own use cases (both inter and intra repo):

1) Pull in specific jar files from normalized distro packages
2) Pull in single configuration files
3) Pull in single JSP files from common utility JSP collections
4) Subversion controlled build.number files for Ant builds
5) Pull in specific license files from common store of all licenses
6) Pull in single packagelist file for offline javadoc compilation

-The Wabbit



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Single file externals plan

Posted by Karl Fogel <kf...@red-bean.com>.
Blair Zajac <bl...@orcaware.com> writes:
> Here's my current thinking on behavior and implementation.
>
> - Support only intra-repository file externals.  This will allow the
> svn client to effectively do a 'touch foo; svn add foo; svn switch URL
> foo' to have a external in the wc (those actual commands only work in
> a 1.5 client).  So unlike a directory external, the .svn/entries file
> has entries for file externals.  This is needed for supporting all the
> client commands on a file.  I don't see modifying the existing
> directory behavior.

Before implementing this, it might be good to find out how often people
use intra-repository externals at all.  My guess (uneducated, anecdotal,
etc) is: not much.  Certainly most of the externals I set are coming
from other repositories...

-Karl




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org