project-navigation
Personal tools

Author Topic: Switch from svn to git without redownloading everything?  (Read 33638 times)

Offline Niggle

  • Cannon Fodder
  • **
  • Posts: 6
    • View Profile
Switch from svn to git without redownloading everything?
« on: September 25, 2010, 11:53:35 am »
Hi,

I've got the last svn code already and I notice that you've now switched to git.

Is there an easy way to switch to using the git repository without having to re-download the entire source over a 1MBit (on a good day) connection? Basically, I want to just update from the last svn version.

Nigel

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
Re: Switch from svn to git without redownloading everything?
« Reply #1 on: September 25, 2010, 05:57:09 pm »
Is there an easy way to switch to using the git repository without having to re-download the entire source over a 1MBit (on a good day) connection? Basically, I want to just update from the last svn version.

No.

-geever

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: Switch from svn to git without redownloading everything?
« Reply #2 on: September 26, 2010, 01:44:03 am »
Somebody mentioned somewhere a 'shallow fetch n' where only the last n revisions are DLed ??

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: Switch from svn to git without redownloading everything?
« Reply #3 on: September 26, 2010, 01:06:35 pm »
Because this was raised

I just want to do very few things
get the source and update the source including 2.3 branch

I got the source on Fri Sep 17
Now i try to update using
git pull -v
and i have to redownload 1.6Gigs into another *.pack file on my disk
next to the already existing one
Why do i need to redownload the whole source again!

I thought!
git clone -v --progress git://ufoai.git.sourceforge.net/gitroot/ufoai/ufoai C:\path\to\somewhere
would get the whole source
git checkout master
would switch into the "current trunk"
git checkout ufoai_2.3
would switch into the 2.3 branch
git pull -v
would update the current branch (master|ufoai_2.3)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Switch from svn to git without redownloading everything?
« Reply #4 on: September 26, 2010, 05:12:13 pm »
you should use

Code: [Select]
git fetch
git rebase '@{u}'

to not add merge commits whenever you have local changes (which might happen for some of your users)

but in general this should only fetch the diffs of course - but we fixed parts of the history recently and this affected almost everything. so either reclone the repo or see http://lists.killfile.pl/pipermail/ufoai/2010-September/001891.html to fix this.

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: Switch from svn to git without redownloading everything?
« Reply #5 on: September 26, 2010, 08:21:56 pm »
Ok, now i am totally confused
Lets say i have 3 brachnes
master
ufoai_2.3
own

1)I'm on ufoai_2.3 and want to update the source
Is it necessary to checkout master first
or can i fetch from ufoai_2.3 branch
1a)would a fetch update master and ufoai_2.3 or only ufoai_2.3
2)I cant switch branches with "open" changes. Would a commit solve this
Let say i have made a small mod on master
and i want to keep this just for me (to fix|cheat|whatever)
I need to commit this to the master (bad idea) but not pushing it (a push would upload any mod?!)
This way i'm able to keep this change
even if i fetch|pull|checkout..
3)a fetch isnt an update, is it? Im getting the updates but im doing nothing with it
3a)pull --rebase would do the same as fetch & rebase?


I hope i got the whole thing right ...
The best is to make your own local branch
doing modifications there
merge this into the master and push it
Than doing changes on the master branch
right?
To update my own branch
i need to update the master branch and merge with my own branch?!

My plan is to support 3|4 branches
master
ufoai_2.3
own
own2?

master & 2.3 is self explaining
the own* branches are for modification
and the user need to handle git on its own
on the own* branches

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Switch from svn to git without redownloading everything?
« Reply #6 on: September 26, 2010, 08:58:39 pm »
1) you can call git fetch from any branch you like or from any directory in the hierarchy of your clone. fetch does not update your working copy - it only fetches the latest commits from the sf.net git repository.

and you have to call git upbase (this is an alias we have set up (see Getting the source) or git rebase '@{u}' from within your branch(es) to merge the new fetched commits into your working copy. Without this you only updated the index (the .git directory in the clone) but not your working copy.

1a) already answered i think

2) see the git stash feature or commit it

3) already answered i think

3a) "pull --rebase" can be used, too

if you make your own branch, you should set the tracking branch to master and just do git upbase to merge the changes from master onto your local commits


Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
Re: Switch from svn to git without redownloading everything?
« Reply #7 on: September 27, 2010, 05:22:07 am »
I wanted to just contribute. And now it is impossible to do it.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Switch from svn to git without redownloading everything?
« Reply #8 on: September 27, 2010, 11:41:52 am »
and the reason is? what isn't documented, what isn't working for you? it doesn't help anyone if you make statements like these.

Offline ManicMiner

  • Squad Leader
  • ****
  • Posts: 113
    • View Profile
Re: Switch from svn to git without redownloading everything?
« Reply #9 on: September 27, 2010, 01:08:46 pm »
Hi Matt,

Sorry to jump in on this thread but I think Kildor makes a vitally important point, which is the size of the initial download. I would contribute if I could, but my broadband connection barely achieves 512mbit on a good day and craps out on a regular basis. Large file downloads (>200mb) are nigh-on impossible to achieve in one go.

I know GIT is better than SVN for poor bandwidth connections generally, but all the same...

I have never had much luck with checking out SVNs for this project and others, but a few months back I was staying in a hotel with a ludicrously fat internet pipe and was able to try the Muton build tool (including getting hold of that >1gb download) and build the game once or twice before going home to my rubbish internet connection.

It took me a good half hour just to download the updates between build versions, even when I was doing it twice a week... and even then it would occasionally FUBAR because the internet connection wasn't stable.

I haven't updated since the start of September simply because downloading 1.6gb worth of data AGAIN (whether using Muton's tool or not) to start the ball rolling, just isn't viable on my domestic internet connection and I can't use the work connection for it either (heavily filtered).

Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
Re: Switch from svn to git without redownloading everything?
« Reply #10 on: September 27, 2010, 01:30:27 pm »
it is impossible to download, to fetch, to update sources.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Switch from svn to git without redownloading everything?
« Reply #11 on: September 27, 2010, 01:55:19 pm »
use rsync:

Code: [Select]
rsync -av ufoai.git.sourceforge.net::gitroot/ufoai/* $DIR_TO_PLACE_THE_REPO_IN

rename the directory into .git and move it into ufoai/.git
edit ufoai/.git/config and change the bare boolean to false
go into ufoai and checkout your working copy

Code: [Select]
git remote set-url --push origin ssh://USER@ufoai.git.sourceforge.net/gitroot/ufoai/ufoai
git remote set-url origin git://ufoai.git.sourceforge.net/gitroot/ufoai/ufoai

i have to admit that i've never ever tested this - but it should work, as it is a repository clone, too.
but the advantage is, that rsync can get continued

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: Switch from svn to git without redownloading everything?
« Reply #12 on: September 28, 2010, 12:39:37 am »
@Kildor:
Don't give up, don't resign !
Admittably, I'm *really* unhappy with that switch to GIT (because I couldn't work on the source for nearly a month now because of GIT).
Mattn helped me a lot, so I was able to do a few unimportant commits until everything screwed up again :(

Let's join and 'fight for the rights' of those who
- have a poor connection
- are occasional contributors (and don't want to DL 1.6 GB just to create a small patch)
- refuse to 'study' GIT and just want to code/map/whatever (ie. Tortoise users)

But let's fight for a solution *with* GIT ! (Mattn says GIT is sooo much better than SVN. I didn't notice any benefits yet, but I DO trust Mattn)

I don't know whether the solutions will be inside or outside (think: SVN-clone of GIT-repo) GIT, but I definitely know that the project will need solutions for the above mentioned problems !

Having said that, let me ask you to be more precise:
it is impossible to download, to fetch, to update sources.
*Why* exactly is it impossible for you ? Bandwidth ? Lack of GIT knowledge ? Whatever ?

Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
Re: Switch from svn to git without redownloading everything?
« Reply #13 on: September 28, 2010, 05:41:39 am »
I don`t like to stay PC for all night, but sometimes it require dozens of hours to simple fetch. And if there will be any fault, I need to restart.
Next. What`s point to work on round the clock, if «git log» simply stay on old commits? «git upbase» require from me to «edit the conflicts» in files I never touch.
And sometimes my commits just loose, and «nothing to push» (or pull, I always mix this words).
And last. The impossibility to have local changes — is evil.

PS: I do not want to learn useless information, git is useless for me. I am not a programmer and never will be. I know what ShiftDel do, and this is easily for me.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Switch from svn to git without redownloading everything?
« Reply #14 on: September 28, 2010, 08:23:34 am »
let me rephrase Kildor, you are saying the devs should not use dev-tools because the none-devs (or those you refuse to learn something new) are not able to handle the dev-tools? so we all have to stay in the last century for this reason? from the dev point of view git is a lot more advanced than svn and really can help us to improve the build/development process. i understand that this is new and learning something new is often time consuming. but trust me, it's worth it. once you got the hang of it, it's quite easy to handle, too.

don't give up and don't be upset - if you need help, let us help. but you have to tell us the exact problem. error messages, commands you did and so on. we are still at the start of the git conversion and i think that things will improve over time. there will hopefully soon be a some local hook scripts that will make dev- and contributors life a little bit easier, too.

anyone tried the rsync method? in theory you should not need to run the PC the whole night, in theory you should be able to continue the git download by entering the same (rsync-)command again.