Re: Why does git-svn redownload revisions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This happens when you have a tag or branch that is a subdirectory of trunk.  It looks like tags/nano_2_1_1 is a branch off trunk/nano.  Git-svn doesn't recognize that trunk/nano@4248 is a subdirectory of trunk@4248 so it starts downloading the complete history of trunk/nano again.

On Sep 8, 2010, at 12:13 PM, Daniel Trebbien wrote:

> The issue is that the fetch runs up to revision 4250, but then mysteriously
> begins redownloading revisions 1 up to four thousand something in importing
> the `nano_2_1_1` tag:
> ...
> r4248 = 7c444dd667b9629ce92a53e8d35ad2d178e5735f (refs/remotes/trunk)
> 	M	nano/ChangeLog
> 	M	nano/configure.ac
> 	M	nano/po/cs.po

> 	M	nano/po/fi.po
> 	M	nano/po/zh_CN.po
> r4249 = 6fbad8a00fa067d1e3de913f77db08c6117843c7 (refs/remotes/trunk)
> 	M	nano/NEWS
> r4250 = 704700855e5112d75654e3e7461e896f49e10fd8 (refs/remotes/trunk)
> Found possible branch point: svn://svn.sv.gnu.org/nano/trunk/nano =>
> svn://svn.sv.gnu.org/nano/tags/nano_2_1_1, 4248
> Initializing parent: refs/remotes/tags/nano_2_1_1@4248
> 	A	mkinstalldirs
> 	A	utils.c
> 	A	nano.h
> 	A	global.c
> 	A	configure
> 	A	Makefile.in

I've encountered the same problem when importing other SVN repos.  If nano is the only subdirectory in trunk, you can fix this by changing your .git/config like this:

-	fetch = trunk:refs/remotes/trunk
+	fetch = trunk/nano:refs/remotes/trunk

This will cause issues if nano is not the only directory in trunk (it won't fetch the others) or if you have branches or tags that branch off the full trunk (you get the same problem).

Or you can downloading both trunk and nano as separate branches.  I think it fetches each revision twice, but it will prevent it from downloading the entire history for each subdirectory branch.

 	fetch = trunk:refs/remotes/trunk
+	fetch = trunk/nano:refs/remotes/nano

This will make your history look a little odd since trunk will have every commit that nano does but be a completely separate branch.  (It also seems to confuse `git-svn find-rev`.)

You can also speed imports like this by creating a local mirror with svnsync and using `git svn clone --use-svnsync-props file:///local/mirror`.  This probably isn't a good long term solution, but can be very handy when you're experimenting with getting it right.  Once you have it set up as you like delete svn-remote.svn.useSvnsyncProps, change svn-remote.svn.url to the original URL, and delete the local mirror.

I've been investigating altering the algorithm that finds branch points to understand branching off subdirectories, but haven't had the time.  It's good to know that the Minix 3 repo isn't the only one that does it.

~~ Brian

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]