Issue 823
| Description: |
Opened: Sat Jul 27 20:59:00 -0700 2002 |
Sort by: Oldest first | Newest first |
When you do this with cvs, you get the directory the file belongs to,
but only containing this file. A subsequent 'cvs update' will pull in
the rest of the directory. I'm not sure whether svn should mimic that
behavior or not, just documenting it.
For export, it may be a good idea not to bother with the containing
directory, and instead just spit out the requested file.
------- Additional comments from Karl Fogel Fri Aug 2 15:35:57 -0700 2002 -------
Marking as 1.0 enhancement.
------- Additional comments from Greg Stein Thu Dec 5 10:13:19 -0700 2002 -------
Good enhancement, but we don't need to block the 1.0 release on this.
It can still be done any time, of course.
------- Additional comments from Nuutti Kotivuori Tue Jan 7 16:01:02 -0700 2003 -------
Does the existence of 'svn cat' modify this issue in any way? It gives
the functionality for getting a single file out of the repository, but
it certainly doesn't give what CVS co for a single file gives.
------- Additional comments from Garrett Rooney Tue Jan 7 16:40:09 -0700 2003 -------
i don't think 'svn cat' mitigates this at all.
the environment we have at work includes a directory with thousands of files in it, and developers work by checking out a small subset of those files. (for the curious, this is a VMS based environment with a build system dating back to the time when subdirectories were /very/ expensive on VMS.) in order for us to think about using svn we would need to be able to check out a single file, then be able to do that again and again, merging the new files into the same working copy. (of course, we'd also have to port APR to VMS, but that's another issue...)
i admit, this is a strange environment, but the fact that one such envoronment exists implies that there are more out there.
all this said though, this is very safely in the post-1.0 category, as i don't see myself having the time and motivation to work on it anytime soon, if ever.
------- Additional comments from Karl Fogel Tue Jan 28 22:35:49 -0700 2003 -------
Kevin Pilch-Bisson mentioned in a mail that he had started this. I'll
just note that here, but leave for him to reassign and mark it as
started at his leisure.
------- Additional comments from Max Bowsher Mon Jan 3 16:27:06 -0700 2005 -------
Re-summarizing to remove all consideration of export from this issue. Seperate
issue 1708 already exists tracking the export case. Note that whilst the export
case is conceptually trivial, the checkout case is not - it's like a special
kind of "svn checkout --non-recursive", which is quite a thorny problem.
------- Additional comments from Max Bowsher Thu Jan 27 08:36:07 -0700 2005 -------
This is really just a convenient UI for:
svn co -N the-dir
svn up the-dir/the-file
As such, depend on the "svn co -N" issue.
------- Additional comments from David Fri Apr 14 19:27:29 -0700 2006 -------
With respect to the original description, cvs allows you to check out a single
file and a subsequent cvs update will only update that file (that may be a
function of my cvs environment and not generally true). For example, if I have
a directory tree like this:
foo/
bar/ blah/ reallybig/
src/ include/ src/ inlude/
a.c b.c a.h b.h blah.c blah.h
If I do:
cvs co foo/bar/src/a.c foo/bar/include/a.h foo/blah/include/blah.h
then if I do:
"cvs update foo", I'll only get the changes that were made to a.c, a.h, and
blah.h. It will not bring in b.c, b.h, blah.c and reallybig. If I pass the -d
flag to cvs update then it will bring in the other stuff.
I find this feature of CVS pretty useful, because I use my project makefiles to
generate a list of dependencies that go into making an application. One of my
make targets is a script that checks out all of the source code that goes into
my application. That way I can check out only what I need for an application
when I check out for remote development.
------- Additional comments from Madan U S Mon Apr 24 07:56:38 -0700 2006 -------
The above proposal is to kindle thoughts on how to achieve single-file
checkouts. I realize that there are possibilities of achieving the same without
the simplistic wc changes proposed in the doc. but, anyways, I wanted to throw
the idea and get a feel of what others think.
------- Additional comments from Ben Collins-Sussman Mon Apr 24 08:17:06 -0700 2006 -------
Madan, it's great that you have a design proposal, but design discussions happen
on the dev@ list, not in the issue tracker. The issue tracker is far too
awkward for design discussions. Perhaps you'd like to start a thread on the
mailing list?
------- Additional comments from Matt McHenry Fri Jul 21 14:41:43 -0700 2006 -------
Max Bowsher's comment from Jan 27 2005 isn't correct. The 'co -N the-dir'
command pulls in all the files in 'the-dir' as well. If you're lucky, 'the-dir'
was added in a separate revision, before any files were added to it. In that
case, you can do:
svn log -v the-dir #manually search for rev NNNN when 'the-dir' was added
svn co -N -r NNNN the-dir
cd the-dir
svn up the-file
If the-dir was added with (other) files all in the same revision, I haven't yet
discovered a way to check out only the-file.
------- Additional comments from David Kilzer Mon Feb 5 08:20:21 -0700 2007 -------
Attachment 621 (svn-co-single-file) is a gross hack that allows you to check out a single file from a
Subversion repository. (It doesn't even use the Subversion Perl bindings--sorry.) I've tested it with
svn-1.3.1 on Mac OS X 10.4.8 and svn-1.4.2 on Debian GNU/Linux etch.
Note that the repository directory that you end up with is partially broken, although I'm not sure of the
cause. If you try to run "svn up" in the directory, it gives this error with svn-1.31 (same error on svn-
1.4.2 without the first line):
subversion/libsvn_repos/reporter.c:849: (apr_err=160005)
svn: Cannot replace a directory from within
Hopefully it's a decent work-around for those who need this functionality.
------- Additional comments from Lieven Govaerts Mon May 21 13:16:21 -0700 2007 -------
With 'depth' currently being added to svn checkout (see issue 781) the new UI
will be:
svn co --depth=empty the-dir
svn up the-dir/the-file
Further running 'svn up' will not fetch any of the other files in the-dir. This
already works on trunk for 1.5-dev servers.
You can fetch the rest of the files with 'svn up --depth=infinity', but this
feature didn't make it on trunk yet.
AFAIC this issue can be closed when the above workaround is completely
implemented. Does anyone disagree?
------- Additional comments from Karl Fogel Mon May 21 15:47:55 -0700 2007 -------
Yes. Between the above workaround, and 'svn cat URL', people will have a way to
get a single file, with or without a surrounding working copy.
------- Additional comments from Karl Fogel Tue Mar 18 19:41:57 -0700 2008 -------
Frankly, I think we can close this now that issue #695 and #781 are closed. The
workarounds are good, and we have no compelling use case (or even semantics) for
anything beyond those workarounds.