It is currently 16 Apr 2024, 10:11
   
Text Size

Git Migration

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Git Migration

Postby Seravy » 03 Jan 2018, 20:36

I'm already done overwriting the SVN files and copying them backwards so I guess it's too late for that.
o_O...the folder sizes. The one that's 200MB in one place is 3MB in the other. Should have noticed that earlier, I'm pretty sure this is not going to work. Might as well not waste the 2 hours of time to copy the folder.

So, assuming I don't have any SVN anymore, what next?
Actually, nevermind.
...at this point I'm starting to think manually applying the changes in the patch files would be faster. Most of them are like 5-10 changed lines and it's plain text...
..or not. Some are a lot bigger... but even for those manual should be better than copying over 50k files each. My HDD isn't that fast...

So I decided to delete everything and start over from cloning as I've already overwritten files which likely isn't a good idea...and now gitlab isn't working. I have internet but gitlab is down so I can't clone anymore. I even checked at http://www.isitdownrightnow.com/git.cardforge.org.html and it's down.

At this point I find it very unlikely to continue working on this at all, considering I haven't even played Forge in the past two months and my fresh Java knowledge is likely already forgotten completely. At best I'll have another attempt at making the already completed patches appear in Git so they can be included, once gitlab stops being offline. If that fails, I'll let friarsol have the patches, hopefully he has better luck with this.
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Git Migration

Postby ShivaFang » 04 Jan 2018, 16:30

Seravy wrote:At this point I find it very unlikely to continue working on this at all, considering I haven't even played Forge in the past two months and my fresh Java knowledge is likely already forgotten completely. At best I'll have another attempt at making the already completed patches appear in Git so they can be included, once gitlab stops being offline. If that fails, I'll let friarsol have the patches, hopefully he has better luck with this.
I feel a bit better knowing I'm not the only one frustrated by the git migration. I managed to get all my code ported over but for some reason I can't update to changes on the actual thing.. it's like it's only rebasing to when I forked the project and not the actual full project - so I can't even get any new cards.
ShivaFang
 
Posts: 101
Joined: 25 Jun 2016, 01:15
Has thanked: 26 times
Been thanked: 3 times

Re: Git Migration

Postby ShivaFang » 04 Jan 2018, 16:49

Okay.. looking at my fork in gitlab... I'm reasonably sure that's exactly what is going on.
https://git.cardforge.org/ShivaFang/forge/tree/master

Every time I try to rebase I'm basically rebasing to this - which is the fork I made last week. How do I get this to have what is on the actual project so I get all the updates?

With svn - literally all I had to do was go VCS/Update (in IntelliJ) and it just worked. I didn't even have to commit anything - I just checked merge conflicts with what was already on my hard drive. Now it feels like I have to log into gitlab - update the fork and then update again in IntelliJ
ShivaFang
 
Posts: 101
Joined: 25 Jun 2016, 01:15
Has thanked: 26 times
Been thanked: 3 times

Re: Git Migration

Postby ShivaFang » 04 Jan 2018, 17:15

Hooray! I figured it out (I think/I hope)

Downloaded Sourcetree and added the original reposatory as a remote source (which I called 'trunk' to separate it from the fork's "origin/master" - I'll know what trunk means because that's what it was called on svn) and did a pull request from that, which got me all the current cards. I also started doing my stuff on it's own branch (which I wasn't before)

Does that sound correct? I got all the RIX stuff that's been posted in the spoiler season thread so seems to be, anway.
ShivaFang
 
Posts: 101
Joined: 25 Jun 2016, 01:15
Has thanked: 26 times
Been thanked: 3 times

Re: Git Migration

Postby silly freak » 04 Jan 2018, 17:35

Sounds exactly right. "upstream" is the customary name for this, but trunk is just as good
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Git Migration

Postby ShivaFang » 05 Jan 2018, 00:18

silly freak wrote:Sounds exactly right. "upstream" is the customary name for this, but trunk is just as good
Okay! I'm a bit emboldened that I figured it out on my own (with a little help from Google directing me to relevant StackExchange posts) that I might start contributing cards (In a 'clean' fork without all my project's code)

The biggest trick was the fact that I figured out that it was rebasing to my fork and not to the upstream. I didn't have any logical reason for knowing that was the problem - I like that I have an 'instinct' for code issues that I can't always explain why I know it.. but sometimes it makes being sure that's what the problem is tricky.
ShivaFang
 
Posts: 101
Joined: 25 Jun 2016, 01:15
Has thanked: 26 times
Been thanked: 3 times

Re: Git Migration

Postby Seravy » 21 Jan 2018, 12:18

Well, I gave this one last attempt. 4 actually. First it couldn't even connect to the site, the next three gave me "cloning from ... read timed out at 30.000 ms".
So unless git.cardforge.org gets fixed to be more responsive, it's unusable. (Note that it takes forever to load (30 seconds+ per page) or fails even in the browser so it's definitely the site's connection.)
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Git Migration

Postby silly freak » 24 Jan 2018, 10:35

Maybe just going to Github or Gitlab would be a good idea? Or do we have any idea what's causing these issues?
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Git Migration

Postby Seravy » 24 Jan 2018, 18:08

After 3 more timeout failures, I tried the command line tool. It worked but took well over an entire minute to connect and start working. I was about to shut the window down when it finally started.
Maybe the project is too large and the server responds too slowly? The first thing that appeared was "remote:counting objects : 521020 done.", I would expect counting 521k files to take this long indeed. If that's the first answer from the server, a timeout is not surprising.

So...now that the cloning is done (yay?) how do I update it to the latest version in Eclipse? Based on previous comments, I have to do that somehow?
I see two types of things in the menu that might be it... pull and fetch. But there is also "Remote->Fetch". Guessing I need that one? With a custom URL? Guessing this one? "https://git.cardforge.org/core-developers/forge.git"
...let's try. well, timeout. Nevermind then I guess NOTHING can be done in Eclipse as is. Okay, I think I exhausted my motivation for this week, maybe later...
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Git Migration

Postby hidalgo » 24 Jan 2018, 22:45

So...now that the cloning is done (yay?) how do I update it to the latest version in Eclipse? Based on previous comments, I have to do that somehow?
I see two types of things in the menu that might be it... pull and fetch. But there is also "Remote->Fetch". Guessing I need that one?
There are 2 repositories a developer normally uses:
1. the original Forge repository
2. the fork created to commit your changes into and later create a merge request

You want to get the latest changes from the original one to your PC.
So you need a fetch from git@git.cardforge.org:core-developers/forge.git

If this is the repository you originally cloned from then `Remote`->`Fetch` is supposed to bring you the up-to-date commits from Forge repo.

Otherwise you cloned from your fork, which in is git@git.cardforge.org:ShivaFang/forge.git
Then `Remote`->`Fetch` only brings you commits from your fork, which you all have in your PC, so you get nothing new.

I guess Eclipse user interface might not be suitable for working with 2 remote repositories, so I'd recommend Git Extensions, which I personally use. Or you can see the screenshots from Git Extensions and try to do the same in Source Tree which you are using.
Fetching original Forge repository from Git extensions | Open
The command I normally use is `Fetch all`.

After `Fetch all` is done I find the head (topmost) commit in `master` branch and do `checkout` command from commit's context menu.

If your local (in your PC) repository was cloned from your fork, not from the original Forge repo, you might need to add the original repository url in Git Extensions menu `Repository` -> `Remote Repositories`, otherwise `Fetch all` will only fetch you the state of your fork, which you already have.

Git-ext-0.jpg
add original repository and fetch all


Git-ext-1.jpg
proof of successfull fetch


When preparing the screenshot above, the first attempt to `fetch all` hanged for a couple of minutes, then I restarted Git Extensions and `Fetch all ` completed succesfully in 10-15 seconds.

If you try Git Extensions and find yourself confused, I can assist you through Discord to make helping more real-time.
User avatar
hidalgo
 
Posts: 354
Joined: 17 Oct 2016, 21:51
Location: Russia, Moscow
Has thanked: 58 times
Been thanked: 80 times

Re: Git Migration

Postby Seravy » 26 Jan 2018, 18:56

Well, a quick google search and guess what I found...

I had similar problem with huge repository. The solution was a quick change of settings:

Window -> Preferences -> Team -> Git -> Remote connections

where "Remote connection timeout (sec)" was set to 30[s]. (30000ms). Set it higher.
I tried looking for such setting myself but haven't found one on my own...but it does exist!
So yeah this is entirely the fault of Eclipse not waiting for the server to send the (large, time consuming) data package. It has nothing to do with server response times.

With this, remote fetch now works, though I'm not sure what I need to pick in the panel that pops up. I assumed the correct one is setting "master" for both the source and destination thing. (there were about a dozen things to pick from, I guess those are branches of the "core"?)

...so now I assume I have to latest version downloaded. Since there are no "run" options here I have to switch back to java perspective to get back the "Normal" menu I used to have and run the game. I suppose I'll need to switch back and forth between perspectives to do actual work and do git operations.

...well, 389 errors but it started! ..but it hangs at "loading cards 100%" because it runs into an error. So I still don't know if I have the right version or not. But unless this many errors is the state of the main version right now, it probably isn't. (btw I hit "checkout" on the master first as I assume that's the command for "I want to work with this one".)

...would reading that git book now help? I did half a year ago but I forgot everything, too much waiting...and I don't think it said much about Eclipse in particular anyway.

(either way, one step closer. At this rate I might reach the start line in another 3 months.)

...okay, so it turns out Eclipse was still trying to compile the leftover stuff in the old svn folders so I deleted those.
Now I managed to bring up the "run as" menu even in the git perspective (only if I open a file by clicking on it though, doesn't seem to matter which one.) - but I have no idea where to go from there. I assume it's "Java Application" and then for project, "forge-gui" and for forge.view.Main as described elsewhere on the forum.
But!
If I do that it says "project is closed" and doesn't work. And I have no idea how to "open" it, I mean it's right there in the git perspective, I can see all the files.

What's a perspective, anyway? A set of window configurations? A plugin to work with like git or svn? Something else?
..anyway, there is an "Open project" in projects which is grey and one in file which isn't but when I pointed it at forge it worked for a while but then still said it's not open when I wanted to run it.

So I'm stuck again. Why am I even still trying, at this point I don't even understand myself.

...okay, a bit more progress, now I have Run working but it gives me "errors. java.lang.NoClassDefFoundError: net/miginfocom/swing/MigLayout"
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Git Migration

Postby Myrd » 21 Mar 2018, 02:35

Is there a summary of how to contribute changes now? I'm not familiar with GitLab's workflow.

Trying to read their docs found a bunch of multi-page articles on how the different workflows between GitHub and GitLab differ and no clear TL;DR. Can we update our project documentation with the minimum needed to contribute? (https://www.slightlymagic.net/wiki/Forg ... ver_to_Git)

e.g. something like:
1. Checkout code, command: " git clone ..."
2. Create a branch, command: " ... "
3. Commit changes, command: " ... "
4. Send merge request, command: " ... "

I assume it's something like the above workflow but couldn't find very clear docs. Also, GitLab is not sending me a confirmation email for account creation, so I'm a bit stuck there too. (Is there a reason we went with GitLab rather than GitHub? GitLab seems a bit less polished and more complicated in the git workflow.)
Myrd
 
Posts: 87
Joined: 24 Nov 2014, 05:58
Has thanked: 4 times
Been thanked: 32 times

Re: Git Migration

Postby Myrd » 21 Mar 2018, 04:08

Myrd wrote:Is there a summary of how to contribute changes now? I'm not familiar with GitLab's workflow.

Trying to read their docs found a bunch of multi-page articles on how the different workflows between GitHub and GitLab differ and no clear TL;DR. Can we update our project documentation with the minimum needed to contribute? (https://www.slightlymagic.net/wiki/Forg ... ver_to_Git)

e.g. something like:
1. Checkout code, command: " git clone ..."
2. Create a branch, command: " ... "
3. Commit changes, command: " ... "
4. Send merge request, command: " ... "

I assume it's something like the above workflow but couldn't find very clear docs. Also, GitLab is not sending me a confirmation email for account creation, so I'm a bit stuck there too. (Is there a reason we went with GitLab rather than GitHub? GitLab seems a bit less polished and more complicated in the git workflow.)
Okay, seems like I figured it out. Sent a merge request for a change: https://git.cardforge.org/core-develope ... /307/diffs

Is the idea that previous committers to SVN like me get direct push access to the main repo, or work off forks and send merge requests?
Myrd
 
Posts: 87
Joined: 24 Nov 2014, 05:58
Has thanked: 4 times
Been thanked: 32 times

Re: Git Migration

Postby friarsol » 21 Mar 2018, 12:48

Myrd wrote:Is the idea that previous committers to SVN like me get direct push access to the main repo, or work off forks and send merge requests?
Everyone works off forks and merge requests. Part of the point was to remove direct access so people couldn't push through code that noone else looked at.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Git Migration

Postby Myrd » 23 Mar 2018, 02:55

friarsol wrote:
Myrd wrote:Is the idea that previous committers to SVN like me get direct push access to the main repo, or work off forks and send merge requests?
Everyone works off forks and merge requests. Part of the point was to remove direct access so people couldn't push through code that noone else looked at.
Ok. How long is it supposed to take to get a patch merged? Am I supposed to actively ask people to merge it or is sending the merge request good enough?
Myrd
 
Posts: 87
Joined: 24 Nov 2014, 05:58
Has thanked: 4 times
Been thanked: 32 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 75 guests


Who is online

In total there are 75 users online :: 0 registered, 0 hidden and 75 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 75 guests

Login Form