The Git/GitHub Questions, Answers and Howto Thread

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
rafafelp
Space Krill
Posts: 9
Joined: Wed Jan 29, 2020 3:06 pm

Re: The Git/GitHub Questions, Answers and Howto Thread

#196 Post by rafafelp »

Hi all.

I don't understand how to do a pull request. I have a branch in a repository, but it doesn't appear in github's menu. (It's to change the layout of the mainpanel in ui/designwnd.cpp).

User avatar
The Silent One
Graphics
Posts: 1129
Joined: Tue Jul 01, 2003 8:27 pm

Re: The Git/GitHub Questions, Answers and Howto Thread

#197 Post by The Silent One »

Not an expert, but: if I go to your github profile, I don't see a repository there. Have you pushed your local repository to upstream?
Which git client do you use, if any?
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.

rafafelp
Space Krill
Posts: 9
Joined: Wed Jan 29, 2020 3:06 pm

Re: The Git/GitHub Questions, Answers and Howto Thread

#198 Post by rafafelp »

I use the basic command line git in Linux. I just tried 'git push --set-upstream origin design-mainwindow-layout'. It said 'remote: Permission to freeorion/freeorion.git denied to rafafelp.'

(Btw the name should mainpanel not mainwindow).

o01eg
Programmer
Posts: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: The Git/GitHub Questions, Answers and Howto Thread

#199 Post by o01eg »

rafafelp wrote: Wed Jan 29, 2020 11:35 pm I use the basic command line git in Linux. I just tried 'git push --set-upstream origin design-mainwindow-layout'. It said 'remote: Permission to freeorion/freeorion.git denied to rafafelp.'

(Btw the name should mainpanel not mainwindow).
Did you fork original FreeOrion repository on github?
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

rafafelp
Space Krill
Posts: 9
Joined: Wed Jan 29, 2020 3:06 pm

Re: The Git/GitHub Questions, Answers and Howto Thread

#200 Post by rafafelp »


o01eg
Programmer
Posts: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: The Git/GitHub Questions, Answers and Howto Thread

#201 Post by o01eg »

You also need to push "Fork" button on GitHub FreeOrion page to have a repository where you have a right to push.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

rafafelp
Space Krill
Posts: 9
Joined: Wed Jan 29, 2020 3:06 pm

Re: The Git/GitHub Questions, Answers and Howto Thread

#202 Post by rafafelp »

Ok, it's done. Thanks.

User avatar
Oberlus
Cosmic Dragon
Posts: 5704
Joined: Mon Apr 10, 2017 4:25 pm

Re: The Git/GitHub Questions, Answers and Howto Thread

#203 Post by Oberlus »

I have a branch KISSHardTarget with the changes from Ophiuchus and some from mine (some corrections that I was lazy to fetch/pull from Ophi's branch and did on my own), which I've been playing with.

Now I want to try some saves from other people. I did:

Code: Select all

freeorion$ git checkout
M	default/scripting/ship_parts/FighterBay/FT_BAY_1.focs.txt
M	default/scripting/ship_parts/FighterHangar/FT_HANGAR_1.focs.txt
M	default/scripting/ship_parts/FighterHangar/FT_HANGAR_2.focs.txt
M	default/scripting/ship_parts/FighterHangar/FT_HANGAR_3.focs.txt
M	default/scripting/ship_parts/ShortRange/SR_SPINAL_ANTIMATTER.focs.txt
M	default/scripting/ship_parts/ShortRange/SR_WEAPON_1_1.focs.txt
M	default/scripting/ship_parts/ShortRange/SR_WEAPON_2_1.focs.txt
M	default/scripting/ship_parts/ShortRange/SR_WEAPON_3_1.focs.txt
M	default/scripting/ship_parts/ShortRange/SR_WEAPON_4_1.focs.txt
M	default/scripting/techs/ship_weapons/fighters/SHP_FIGHTERS_2.focs.txt
M	default/scripting/techs/ship_weapons/fighters/SHP_FIGHTERS_3.focs.txt
M	default/scripting/techs/ship_weapons/fighters/SHP_FIGHTERS_4.focs.txt
M	default/stringtables/en.txt
freeorion$ git fetch upstream 
remote: Enumerating objects: 1678, done.
remote: Counting objects: 100% (1678/1678), done.
remote: Compressing objects: 100% (182/182), done.
remote: Total 2337 (delta 1512), reused 1656 (delta 1496), pack-reused 659
Receiving objects: 100% (2337/2337), 924.98 KiB | 397.00 KiB/s, done.
Resolving deltas: 100% (1868/1868), completed with 280 local objects.
From https://github.com/freeorion/freeorion
 * [new branch]      AppVeyor_MSVC_Configs_Build_test -> upstream/AppVeyor_MSVC_Configs_Build_test
 + 540aaa2...0b214ec Government -> upstream/Government  (forced update)
 * [new branch]      Government2 -> upstream/Government2
   b9842c4..3eb7770  master     -> upstream/master
   cb8e1a3..911179b  weekly-test-builds -> upstream/weekly-test-builds
 * [new tag]         v0.4.9-rc1 -> v0.4.9-rc1
 * [new tag]         v0.4.9-rc2 -> v0.4.9-rc2
 * [new tag]         v0.4.9-rc3 -> v0.4.9-rc3
 * [new tag]         with-FreeOrionSDK-v11 -> with-FreeOrionSDK-v11
freeorion$ git branch -l
  CombatSystem_CacheTargets
  Government
* KISSHardTarget
  MissilesBackend
  master
  release-v0.4.8
  release-v0.4.9
  warbots
freeorion$ git checkout master 
error: Your local changes to the following files would be overwritten by checkout:
	default/stringtables/en.txt
Please, commit your changes or stash them before you can switch branches.
Aborting
Here I thought "that must be one of my manual changes, not important since they are also in Ophi's branch, so I will get rid of them", and I looked up how to do that and found a way:

Code: Select all

freeorion$ git checkout -- default/stringtables/en.txt
freeorion$ git checkout master 
M	default/scripting/ship_parts/FighterBay/FT_BAY_1.focs.txt
M	default/scripting/ship_parts/FighterHangar/FT_HANGAR_1.focs.txt
M	default/scripting/ship_parts/FighterHangar/FT_HANGAR_2.focs.txt
M	default/scripting/ship_parts/FighterHangar/FT_HANGAR_3.focs.txt
M	default/scripting/ship_parts/ShortRange/SR_SPINAL_ANTIMATTER.focs.txt
M	default/scripting/ship_parts/ShortRange/SR_WEAPON_1_1.focs.txt
M	default/scripting/ship_parts/ShortRange/SR_WEAPON_2_1.focs.txt
M	default/scripting/ship_parts/ShortRange/SR_WEAPON_3_1.focs.txt
M	default/scripting/ship_parts/ShortRange/SR_WEAPON_4_1.focs.txt
M	default/scripting/techs/ship_weapons/fighters/SHP_FIGHTERS_2.focs.txt
M	default/scripting/techs/ship_weapons/fighters/SHP_FIGHTERS_3.focs.txt
M	default/scripting/techs/ship_weapons/fighters/SHP_FIGHTERS_4.focs.txt
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 15 commits.
  (use "git push" to publish your local commits)
freeorion$ git pull upstream master 
error: Cannot pull with rebase: You have unstaged changes.
Now I'm really lost.
I have not made any changes in my local master.
Is this telling me that my local master has now all changes from KISSHardTarget that I didn't stash?

Edit: In the end I did a commit all to a new branch and a hard reset to upstream/master. Seems OK.

Ophiuchus
Programmer
Posts: 3427
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: The Git/GitHub Questions, Answers and Howto Thread

#204 Post by Ophiuchus »

Oberlus wrote: Fri Mar 20, 2020 7:14 am

Code: Select all

freeorion$ git checkout -- default/stringtables/en.txt
That only changed the single file (en.txt) to the current HEAD version of your workspace. So all the other modified files (M) were not affected by this.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Oberlus
Cosmic Dragon
Posts: 5704
Joined: Mon Apr 10, 2017 4:25 pm

Re: The Git/GitHub Questions, Answers and Howto Thread

#205 Post by Oberlus »

Ophiuchus wrote: Sun Mar 22, 2020 10:53 am That only changed the single file (en.txt) to the current HEAD version of your workspace. So all the other modified files (M) were not affected by this.
So the problem was that I had not committed the changes in KISSHardTarget branch? I still don't understand shit.

Now I have other problems after fetching master:

- I'm in a detachef head state.
- Checkout master and doing cmake throws me error about minimum python should be 3.5 while I have 2.7.12.
- Checkout v0.4.9 and cmake works but trying to compile throws me internal compiler errors of segmentation fault at GG/src/dialogs/ColorDlg.cpp:1:0 (a comment line) and at parse/ArithmeticRules.cpp:1:0 (an include clause).

This is Ubuntu 16.04.

Ophiuchus
Programmer
Posts: 3427
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: The Git/GitHub Questions, Answers and Howto Thread

#206 Post by Ophiuchus »

Oberlus wrote: Sun Mar 22, 2020 12:06 pm
Ophiuchus wrote: Sun Mar 22, 2020 10:53 am That only changed the single file (en.txt) to the current HEAD version of your workspace. So all the other modified files (M) were not affected by this.
So the problem was that I had not committed the changes in KISSHardTarget branch? I still don't understand shit.

Now I have other problems after fetching master:

- I'm in a detachef head state.
- Checkout master and doing cmake throws me error about minimum python should be 3.5 while I have 2.7.12.
- Checkout v0.4.9 and cmake works but trying to compile throws me internal compiler errors of segmentation fault at GG/src/dialogs/ColorDlg.cpp:1:0 (a comment line) and at parse/ArithmeticRules.cpp:1:0 (an include clause).

This is Ubuntu 16.04.
Well, there is the python migration ongoing - this will be the next release feature. I am not sure if python2 is supported anymore. Install yourself python 3.5 with "apt install python3" - xenial has python 3.5.1 available.

Not sure about the compiler prob, but this is most likely not a git issue. To make sure - what is the output of "git status" ?
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Oberlus
Cosmic Dragon
Posts: 5704
Joined: Mon Apr 10, 2017 4:25 pm

Re: The Git/GitHub Questions, Answers and Howto Thread

#207 Post by Oberlus »

Ophiuchus wrote: Sun Mar 22, 2020 12:54 pmWell, there is the python migration ongoing - this will be the next release feature. I am not sure if python2 is supported anymore. Install yourself python 3.5 with "apt install python3" - xenial has python 3.5.1 available.
Python 3.5 was already installed, so I don't know what else to do:

Code: Select all

~$ sudo apt-get install python3.5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3.5 is already the newest version (3.5.2-2ubuntu0~16.04.9).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Not sure about the compiler prob, but this is most likely not a git issue. To make sure - what is the output of "git status" ?

Code: Select all

~/Projects/FreeOrion/freeorion$ git status
HEAD detached at v0.4.9
nothing to commit, working directory clean

o01eg
Programmer
Posts: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: The Git/GitHub Questions, Answers and Howto Thread

#208 Post by o01eg »

Ophiuchus wrote: Sun Mar 22, 2020 12:54 pm
Oberlus wrote: Sun Mar 22, 2020 12:06 pm This is Ubuntu 16.04.
Well, there is the python migration ongoing - this will be the next release feature. I am not sure if python2 is supported anymore. Install yourself python 3.5 with "apt install python3" - xenial has python 3.5.1 available.

Not sure about the compiler prob, but this is most likely not a git issue. To make sure - what is the output of "git status" ?
Ubuntu 16.04 doesn't have boost-python3 available.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Oberlus
Cosmic Dragon
Posts: 5704
Joined: Mon Apr 10, 2017 4:25 pm

Re: The Git/GitHub Questions, Answers and Howto Thread

#209 Post by Oberlus »

o01eg wrote: Sun Mar 22, 2020 4:10 pm
Ophiuchus wrote: Sun Mar 22, 2020 12:54 pm
Oberlus wrote: Sun Mar 22, 2020 12:06 pm This is Ubuntu 16.04.
Well, there is the python migration ongoing - this will be the next release feature. I am not sure if python2 is supported anymore. Install yourself python 3.5 with "apt install python3" - xenial has python 3.5.1 available.

Not sure about the compiler prob, but this is most likely not a git issue. To make sure - what is the output of "git status" ?
Ubuntu 16.04 doesn't have boost-python3 available.
Does this mean I should upgrade to 18.04 for FO 0.4.10?

o01eg
Programmer
Posts: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: The Git/GitHub Questions, Answers and Howto Thread

#210 Post by o01eg »

Oberlus wrote: Sun Mar 22, 2020 8:17 pm
o01eg wrote: Sun Mar 22, 2020 4:10 pm
Ophiuchus wrote: Sun Mar 22, 2020 12:54 pm
Well, there is the python migration ongoing - this will be the next release feature. I am not sure if python2 is supported anymore. Install yourself python 3.5 with "apt install python3" - xenial has python 3.5.1 available.

Not sure about the compiler prob, but this is most likely not a git issue. To make sure - what is the output of "git status" ?
Ubuntu 16.04 doesn't have boost-python3 available.
Does this mean I should upgrade to 18.04 for FO 0.4.10?
Yep
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

Post Reply