Learning to use git and github

nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Learning to use git and github

Post by nick »

I've fixed the problem :)
It was in SaveVisitor/LoadVisitor, where each saved matrix transform was getting overwritten by the next one. Now they are saved as a JSON array.
Pioneer now saves and loads to completion - resulting in a running game that appears to be good.

My efforts are now directed to learning git and winmerge.

Thank you all for your help and advice. I will be following it closely, and any questions I have will be posted here.
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Learning to use git and github

Post by nick »

I'm running Visual C++ 2013. I keep getting told that line endings are not consistent, and do I want to normalise the line endings?

I don't think it matters what I do here (git will sort out the line endings) but is there a recommendation for normalisation? Windows? Unix?
[Edit] git might detect different line endings as a change that must be committed
[Edit] I think I should select to normalise as windows (CR LF) as git will have created my source using windows line endings. But then - how has a non-windows line ending got in there?!
[Edit] git makes no distinction between line endings :) Actually it does: git says the file is modified. This means I'll have a bunch of commits entited "changing line-endings".
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Learning to use git and github

Post by nick »

All good so far.

git checkout upstream/master
git checkout -b JSONSerialise

Merged helper functions into utils.h/utils.cpp
git commit -a -m "Helper functions for JSON serialisation (including floating point to/from string)."

Added the two new files containing the JSON helper functions
git add contrib/json/JsonUtils.h
git add contrib/json/JsonUtils.cpp
git commit -a -m "JSON helper functions. Updated VC++ project files. Normalised line endings."

I'll continue like this - small chunks at a time with commits.
The switch to using the JSON system will happen when all the new code is added. At this point I'll remove the old code.
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Learning to use git and github

Post by FluffyFreak »

This is good, once you've gotten used to the benefits of version control I promise you will never go back :)

I use it on personal projects and even for backing up and tracking my business information!
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Learning to use git and github

Post by nick »

Thanks :)
I use subversion (and tortoisesvn) for my computer algebra system. It's my personal project so I'm the only developer and I don't have to do merges. If fact, I don't even use branches and just commit to trunk all the time.
I'm pleased I'm learning git - it's been a lot to take in though!

I may complete all the JSON commits this evening. Pioneer compiles at every stage, but I'm getting linker errors:
error LNK2001: unresolved external symbol __imp__curl_easy_cleanup C:\Users\Nick\Documents\Nick\Programming\C and C++\Pioneer\pioneer\win32\vc2013Express\ServerAgent.obj pioneer

The symbols are defined in pioneer-thirdparty\win32\include\curl\easy.h
Any idea why this is happening? (BTW I did update the thirdparty source)

When I complete the JSON commits, and run some tests, my next move is:
* Merge to my local branch, any changes that have occurred in 'upstream'
* Push my local branch to my origin repo on git hub
* Submit another PR?
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Learning to use git and github

Post by FluffyFreak »

Do you have the latest from pioneer-thirdparty? Some new libraries (libcurl) were recently added too it so just grab the latest for that and it should link.
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Learning to use git and github

Post by nick »

I downloaded pioneer-thirdparty again last night (as a zip) and it was binary equal to the one I downloaded when I started work on the new branch JSONSerialise. The relative path is the same as before.

Although one difference, is the name of my pioneer root directory - now "pioneer" instead of "pioneer-master".
I have "pioneer-thirdparty", side-by-side with "pioneer".

I'll re-download pioneer-thirdparty to be sure. BTW, to get it I go to https://github.com/pioneerspacesim/pion ... dparty.git and download the zip file.
Perhaps I should clone it from github, but that would lead to difficult questions for me - like will it be part of branch JSONSerialise? Or master?
Extracting the downloaded zip (and renaming "pioneer-thirdparty-master" to "pioneer-thirdparty") worked before.
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Learning to use git and github

Post by FluffyFreak »

I have it checked out via Git, that way it's easy to keep up to date without downloading the whole thing as a zip each time.

It also means that when you need to you can contribute too it. It doesn't mean it's got anything to do with your pioneer branch.
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Learning to use git and github

Post by nick »

In git bash, from the directory in which the pioneer root directory resides, I execute:
git clone git://github.com/pioneerspacesim/pioneer-thirdparty.git
(after I've rename the existing pioneer-thirdparty directory).
[Edit] Cloning now - looking good :)
[Edit] Hmmm, still getting the linker errors.
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Learning to use git and github

Post by nick »

I can think of 3 possible causes:

(1) Pioneer root folder should be renamed to "pioneer-master".

(2) Compiling guide says 'After cloning the repo, move it to a folder called "pioneer-thirdparty" alongside your "pioneer" folder.'
So the "pioneer-thirdparty" folder created by the clone command might need to be put in another folder called "pioneer-thirdparty"?

(3) The two new files I've added need to be referenced in some other part of the source code.

[Edit] Going to continue with the JSON commits and come back to this later.
Last edited by nick on Mon Feb 16, 2015 10:31 pm, edited 1 time in total.
Post Reply