FreeOrion

Forums for the FreeOrion project
It is currently Wed Nov 22, 2017 9:18 am

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Mon Mar 27, 2017 12:47 pm 
Offline
Dyson Forest
User avatar

Joined: Sun Jun 08, 2014 1:18 am
Posts: 214
Right now I have the Mac OSX SDK, and it has the latest code from the master branch (freeorion:master).
(Very new to the GitHub environment, and working with remote code repositories.)

Suppose I wanted to test a PR, for example the code in the branch "Morlic-fo:CarrierVsPlanets".
How do I go about getting those code changes from XCode?

Or do I need to go to the "file changed" GitHub website tab, look over the "diff", and make those changes myself?


Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 12:55 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12016
Location: Munich
There are probably better methods, but the most reliable method I've found (on Windows) is to go to the pull request's page, scroll down to the part below the integration build reports, where there is a link to show the command line instructions. Click the button to copy the commands for "Step 1: From your project repository, check out a new branch and test the changes." Then paste those into a command line in the directory where you've got the repository (for me, C:\Users\Geoff\Desktop\FreeOrionSDK5\FreeOrion ). Then build.

Quirks may occur if the branch is updated after you first pull it, and you want to pull again. The most reliable method I've found in that case is to switch back to master, delete the local branch, then re-create and pull it again using the same method as above.


Attachments:
File comment: getting a branch
get_branch.png
get_branch.png [ 73.04 KiB | Viewed 545 times ]
Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 1:40 pm 
Offline
Dyson Forest
User avatar

Joined: Sun Jun 08, 2014 1:18 am
Posts: 214
Geoff the Medio wrote:
...go to the pull request's page, scroll down to the part below the integration build reports, where there is a link to show the command line instructions...

I do not see an integration build report on the web page.

While looking at some of the discussions on the bug and PR pages, there were mentions of work tools like "Travis CI" and "Appveyor". Do I need that (or other tools) in order to get the extra information that you are seeing?

------

On a side note, that attached image helped a lot.
That clued me in to the protocol for seeing other people's branches (in your example, LGM-Doyle).
It probably isn't the best way, but I can find Morlic-fo's branch CarrierVsPlanets and download a copy. (Then I can copy the changed files to my FO build).


Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 1:43 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12016
Location: Munich
Hmm, indeed that section is missing when I view the pull request page not logged in. In that case, I don't know how people who aren't logged in are supposed to check out pull requests to test. Someone else will have to comment on that.

Alternatively, google it. I suspect the issue has come up many times...


Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 2:25 pm 
Offline
Programmer
User avatar

Joined: Fri Mar 01, 2013 9:52 am
Posts: 1040
Location: Germany
Quote:
I don't know how people who aren't logged in are supposed to check out pull requests to test.


I would assume "not at all". How are supposed to give feedback on a Pull Request if you can't write comments on it because you don't have a GitHub account (or are not logged in to GitHub)?

Quote:
While looking at some of the discussions on the bug and PR pages, there were mentions of work tools like "Travis CI" and "Appveyor".


You can't install any of those, as they are services and not programs. See also: viewtopic.php?f=9&t=10420

_________________
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz


Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 2:27 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12016
Location: Munich
adrian_broher wrote:
I would assume "not at all". How are supposed to give feedback on a Pull Request if you can't write comments on it because you don't have a GitHub account (or are not logged in to GitHub)?
I would guess that potential testers would be more likely to check out and test a pull request if they could do so without having to make an account first, and that after having tested and found something they wanted to comment about it, they might then make the account to be able to do so.


Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 2:40 pm 
Offline
Programmer
User avatar

Joined: Fri Mar 01, 2013 9:52 am
Posts: 1040
Location: Germany
Geoff the Medio wrote:
adrian_broher wrote:
I would assume "not at all". How are supposed to give feedback on a Pull Request if you can't write comments on it because you don't have a GitHub account (or are not logged in to GitHub)?
I would guess that potential testers would be more likely to check out and test a pull request if they could do so without having to make an account first, and that after having tested and found something they wanted to comment about it, they might then make the account to be able to do so.


Well, GitHub seems to disagree with your opinion so no point discussing that.

_________________
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz


Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 2:51 pm 
Offline
Programmer
User avatar

Joined: Fri Mar 01, 2013 9:52 am
Posts: 1040
Location: Germany
Quote:
How do I go about getting those code changes from XCode?


Probably the best way to go for your would be the hub tool provided by github. It add an additional layer on top of the `git` tool and allows you to feed git some github url and do the right thing. However I don't know if it needs a GitHub account or not (I would assume not).

For example checking out a pull request:

git checkout https://github.com/github/hub/pull/134

Which is exactly the same URL as you would use to visit the discussion page of a pull request.

Quote:
Or do I need to go to the "file changed" GitHub website tab, look over the "diff", and make those changes myself?


Unless you have nothing better to do I would advise against that.

_________________
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz


Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 2:54 pm 
Offline
Programmer
User avatar

Joined: Fri Mar 01, 2013 9:52 am
Posts: 1040
Location: Germany
There is also the GitHub manual:

https://help.github.com/articles/checki ... atform-mac

Follow the section "Modifying an inactive pull request locally"; steps 1 to 6. The steps after that are for pushing changes to the PR, which you're not allowed to anyway.

_________________
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz


Last edited by adrian_broher on Mon Mar 27, 2017 3:06 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 3:02 pm 
Offline
Dyson Forest
User avatar

Joined: Sun Jun 08, 2014 1:18 am
Posts: 214
I have a github account (memem359). Was logged in the whole time.

I've attached a PDF of what I see on the PR page.
(Maybe the ib report staring me in the face, and hiding in my blind spot?)

In any case, I've found a solution for my situation, and I'll post that next (so I don't forget).


Attachments:
File comment: we can't attach PDF files? hmm, try jpg instead
github_pr_page.jpg
github_pr_page.jpg [ 308.99 KiB | Viewed 533 times ]
Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 3:16 pm 
Offline
Dyson Forest
User avatar

Joined: Sun Jun 08, 2014 1:18 am
Posts: 214
Maybe this will help someone else who is (also) inexperienced with XCode/GitHub/FO.
(And in case I forget this in the future.)

  • Open XCode with the FO Mac OSX SDK. (I assume that the origin/master code has already been downloaded.)
  • Source Control -> (whatever your Working Copy is named, has a right triangle) -> Configure (last item after the branch options)
  • In the Configure drop down window, click the "Remotes" tab. Hit the "+" button -> Add Remote
  • Fill in the information. The address will be "https://github.com/(user_name)/freeorion.git", where you need to fill in the appropriate user name.
  • Now when I go to Source Control -> Pull... the scrolling options will include all the branches that user has in their GitHub repository. (Just need to match what was listed on the Pull Request web page.)


Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 6:09 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3264
OK, the easiest way for a tester/scripter is to have a version of Git installed on their machine and then learn how to configure a Remote.

I've been meaning to write up a howto for ages but today I still have flu symptoms so this is a summary and hopefully together we can work it through.

First, you need to clone the FO repo using Git. Then tell your game client to use the Git repo on your machine not the default from the install: that's in Options (NB: I have zero clue how Macs work or how things're installed on them so I'm not going to go into detail on this, you may already have needed a copy of the source code).

Once you've done that, using the Command line/GitBash console to create a Remote called 'morlic' (I found instructions easily online, create new Git remore is a good search term), usign the URL of Morlic-fo's FO github clone.

Then, you need to checkout that branch, so 'git checkout morlic/CarrierVsPlanets'

This will put you into what's called "detached head" status where you're playing with a copy of a repo, you can branch off it and make changes but you don't need to. That should work.

There might be a need to rebase things onto master for the most recent test release, if that is needed then further instructions can be written.

We do need to have a "how to use git to test stuff" set of instructions for tester/low level scripters/players and I've been meaning to writ it up for ages, perhaps if you get this going OK you could help with it? Experienced coders need to learn Git proper, you and I don't really, but being able to test a PR that just changes scripts is very useful.

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 10:15 pm 
Offline
Programmer

Joined: Sun Feb 14, 2016 12:08 am
Posts: 342
I've always done it same as MatGB, which does not need any login (and does not need a PR).
Just to reiterate, given a cloned freeorion repo:

Add remote: once for any persons repo :
Code:
git remote add Morlic-fo https://github.com/Morlic-fo/freeorion/freeorion.git


Fetch: any time the repo changes, before switching to their branch:
Code:
git fetch Morlic-fo


Checkout: the branch of a PR is listed in the top right (Morlic-fo:CarrierVsPlanets)
Code:
git checkout Morlic-fo/CarrierVsPlanets


Maybe over-cautionary, but I also remove *.pyc files if there are *.py changes.

Quote:
the hub tool provided by github

Outside of not needing to setup and sync a remote, are there other benefits to this?

_________________
Any content posted should be considered licensed GNU GPL 2.0 and/or CC-BY-SA 3.0 as appropriate.


Top
 Profile  
 
PostPosted: Tue Mar 28, 2017 8:29 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4243
Location: Sol III
mem359 wrote:
Maybe this will help someone else who is (also) inexperienced with XCode/GitHub/FO.
(And in case I forget this in the future.)

  • Open XCode with the FO Mac OSX SDK. (I assume that the origin/master code has already been downloaded.)
  • Source Control -> (whatever your Working Copy is named, has a right triangle) -> Configure (last item after the branch options)
  • In the Configure drop down window, click the "Remotes" tab. Hit the "+" button -> Add Remote
  • Fill in the information. The address will be "https://github.com/(user_name)/freeorion.git", where you need to fill in the appropriate user name.
  • Now when I go to Source Control -> Pull... the scrolling options will include all the branches that user has in their GitHub repository. (Just need to match what was listed on the Pull Request web page.)
That is basically using Xcode as your git client, which is possible and might serve your purposes well enough. However, I recommend to use either the git command line client (most flexible and powerful, but also more difficult to learn) or one of the git GUI clients (SmartGit, SourceTree, etc.). In any case you should head over to the official git homepage and read the first chapters of the git documentation. These should give you a good introduction and cover the basic concepts of git.

Hint: Mat and dbenage-cx are on Linux, things work a bit differently there, mostly because there is no SDK for Linux (not needed on that platform). On Mac, once you've set up your development environment with the SDK you already have a cloned repo and checked out master branch (the bootstrap.sh script does that for you). So you can skip the instructions about cloning the repo and setting up your local copy.

There is also the (somewhat lengthy) The Git/GitHub Questions, Answers and Howto Thread. I know it looks a bit much, but digging through it might also help you along.


Top
 Profile  
 
PostPosted: Tue Mar 28, 2017 9:41 am 
Offline
Programmer
User avatar

Joined: Fri Mar 01, 2013 9:52 am
Posts: 1040
Location: Germany
dbenage-cx wrote:
Outside of not needing to setup and sync a remote, are there other benefits to this?


No, you just have a nicer interface to access GitHub (e.g. hub checkout <some github web UI url pointing to a PR, branch, commit>) and it does add some additional features like `list issues/PR`, `create a PR` and other things you can also do via the Web UI. For a full feature you can take a look into the man page. I personally don't use it, because I already had some git alias commands set up for git related tasks and github related task I handle via the web UI, but for someone else it might be helpful.

_________________
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group