views:

84

answers:

4

I am trying to git clone the LibreOffice codebase, but at the moment I have an internet connection by mobile phone and it's just anything but stable. I can get the connection back any moment, but then the git clone process already stopped working, and no way to get it running again. Is there some way to have a more failure-resistant git clone download?

One option I considered myself is to download someone else's .git directory, but that is overly dependent of others and doesn't seem like the best possible solution to me.

A: 

If you have access to a 3rd-party server, you could clone there and then copy.

Amber
A: 

I don't think this is ready yet. There's an old GSoC page that which planned to implement your desired feature. My best bet is, like you suggested download it as a directory. I'm assuming you are able to resume downloads over other protocols.

Restartable Clone

When cloning a large repository (such as KDE, Open Office, Linux kernel) there is currently no way to restart an interrupted clone. It may take considerable time for a user on the end of a small pipe to download the data, and if the clone is interrupted in the middle the user currently needs to start over from the beginning and try again. For some users this may make it impossible to clone a large repository.

Goal: Allow git-clone to automatically resume a previously failed download over the native git:// protocol. Language: C Mentor: Shawn Pearce Suggested by: Shawn Pearce on gmane

Ashish
Thanks for the information, so my problem is known and a solution is worked on... What would you recommend as a work-around?
LaPingvino
I would say if you can clone it some place else, just copy is from there. Or if you can download it as a directory (the .git and other stuff that's there) then you do that. Almost all download managers will let you resume your regular downloads (the directory method).
Ashish
I know that one. The worst thing however is that it's one anonymous download over the git-protocol first, then there's a script to do 19 more git clones
LaPingvino
Oh! Get someone to clone it for you on a flash drive or something then. :P
Ashish
The problem is that all connections are crap here... I think I'll have to put it all on a server and then download it by scp... I just only have Shared Hosting ssh access, so I don't know about git on those machines... :(
LaPingvino
Maybe off-topic, but this might work as a possible implementation for a more failsave git clone:* Have an option to make this possible (like --flacky-connection)* While using this option, implement clone as just a clone of the first revision, then update in blocks with git pull.
LaPingvino
Would work if the first revision is small. Could happen that the initial revision is big enough to be painful. But, hey, it's all open-source. ;)
Ashish
A: 

You can try to use mercurial with the hg-git extension.

If that doesn't work you can can use git fetch <commit-id> to fetch only parts of a remote git repository (you can fetch into an empty git repository, there is no need to create it with clone). But you might to correct the branch configuration (=create local and remote tracking branches) when you use this approach.

Rudi
+2  A: 

Two solutions (or rather workarounds) that come to mind are:

  • Use shallow clone i.e. git clone --depth=1, then deepen this clone using git fetch --depth=N, with increasing N (I think, but I am not sure about this, that you can use --depth=1 to make repository un-shallow). Not sure it would work.

  • Ask somebody to prepare bundle up to some tagged release (see git-bundle(1) manpage). The bundle itself is an ordinary file, which you can download any way, via HTTP/FTP with resume support, via BitTorrent, via rsync, etc. The you can create clone from bundle, fix configuration, and do further fetches from official LibreOffice repository.

Jakub Narębski