advance planning for migration to git

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

Moderator: Committer

Message
Author
User avatar
Dilvish
AI Lead, Programmer
Posts: 4712
Joined: Sat Sep 22, 2012 6:25 pm

advance planning for migration to git

#1 Post by Dilvish » Wed Feb 25, 2015 4:26 pm

To plan ahead a little for the expected "someday" on which we migrate to git, one of the things that comes to mind that will need adjustment is our version number handling-- right now it is based on svn version number and I'm not aware of a simple substitute from git. A couple threads regarding getting a roughly comparable number out of git can be found here and here, and a discussion including a little more detail on how to actually use that number to mark revisions can be found here.

Has anyone here had experience with this or any other svn-to-git transition issue? If so, please flag the potential issues here along with any suggested solutions.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: advance planning for migration to git

#2 Post by MatGB » Wed Feb 25, 2015 5:48 pm

Question, is the plan to migrate from Sourceforge to Github, or to convert the Sourceforge repo from using SVN to Git? I know the latter is possible as FreeCol did it last year, but I had no direct involvement in that, but the FreeCol Devs would almost certainly be happy to pass experience on if the latter is the plan.
Mat Bowles

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

o01eg
Space Kraken
Posts: 169
Joined: Sat Dec 10, 2011 5:46 am

Re: advance planning for migration to git

#3 Post by o01eg » Wed Feb 25, 2015 5:52 pm

Mercurial has a local revision numbers.
Gentoo Linux x64, gcc-7.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.3, boost-1.65.1
Welcome to multiplayer server at freeorion-test.dedyn.io.Version 0.4.8
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

User avatar
Vezzra
Release Manager, Design
Posts: 4664
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: advance planning for migration to git

#4 Post by Vezzra » Wed Feb 25, 2015 6:39 pm

Dilvish wrote:one of the things that comes to mind that will need adjustment is our version number handling-- right now it is based on svn version number and I'm not aware of a simple substitute from git
AFAIK there is none. I've already thought about that issue when I read through the git tutorials, and assuming we'd want to avoid overly complicated solutions, I see these options:
  • Simply using the hash id of the commits (probably not very appealing)
  • Using git describe
  • Tagging each commit that becomes the base of a (test) build (even the weekly ones)
Personally I think that the second option (combined with reasonable tagging) will probably be the best solution.

User avatar
Vezzra
Release Manager, Design
Posts: 4664
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: advance planning for migration to git

#5 Post by Vezzra » Wed Feb 25, 2015 6:40 pm

MatGB wrote:Question, is the plan to migrate from Sourceforge to Github, or to convert the Sourceforge repo from using SVN to Git?
Both.
the FreeCol Devs would almost certainly be happy to pass experience on if the latter is the plan.
Hm, I guess it'll be worth asking them...

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12268
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: advance planning for migration to git

#6 Post by Geoff the Medio » Wed Feb 25, 2015 6:41 pm

Vezzra wrote:git describe
Could you describe git describe?

User avatar
Vezzra
Release Manager, Design
Posts: 4664
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: advance planning for migration to git

#7 Post by Vezzra » Wed Feb 25, 2015 6:51 pm

Geoff the Medio wrote:Could you describe git describe?
http://git-scm.com/book/en/v2/Distribut ... ild-Number

Chriss
Dyson Forest
Posts: 231
Joined: Sun May 11, 2008 10:50 am

Re: advance planning for migration to git

#8 Post by Chriss » Thu Feb 26, 2015 10:39 pm

Version number? The version which gets displayed in the bottom right corner of the game?
Attached patches are released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12268
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: advance planning for migration to git

#9 Post by Geoff the Medio » Thu Feb 26, 2015 10:48 pm

Chriss wrote:Version number? The version which gets displayed in the bottom right corner of the game?
And what's used to discuss various versions of code in SVN, such as for identifying which commit introduced or fixed a bug or feature or similar.

User avatar
Vezzra
Release Manager, Design
Posts: 4664
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: advance planning for migration to git

#10 Post by Vezzra » Fri Feb 27, 2015 8:21 am

Chriss wrote:Version number? The version which gets displayed in the bottom right corner of the game?
More specifically the part of the version string with the SVN revision number.

User avatar
em3
Vacuum Dragon
Posts: 508
Joined: Sun Sep 25, 2011 2:51 pm

Re: advance planning for migration to git

#11 Post by em3 » Fri Feb 27, 2015 1:29 pm

Git describe seems very sensible.
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556

User avatar
Cjkjvfnby
AI Contributor
Posts: 452
Joined: Tue Jun 24, 2014 9:55 pm

Re: advance planning for migration to git

#12 Post by Cjkjvfnby » Fri Feb 27, 2015 2:23 pm

em3 wrote:Git describe seems very sensible.
Git describe wants tag. Otherwise it can get just commit hash.

IMHO game version can look like: <date> <branch>(<commit>) 42 Jan 2015 master(18e1fd144)

Date will help with commit order and it is human readable
Branch will allow to check if build is special (may be omit for master)
Hash points exact commit and useful for developers

Tag can be set by github when you add release (see release tab on main repo page)
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Vezzra
Release Manager, Design
Posts: 4664
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: advance planning for migration to git

#13 Post by Vezzra » Thu Mar 12, 2015 12:26 pm

I've posted a proposal on the migration procedure here (I think the FreeOrion Project forum is better suited for this kind of discussion).

User avatar
Cjkjvfnby
AI Contributor
Posts: 452
Joined: Tue Jun 24, 2014 9:55 pm

Re: advance planning for migration to git

#14 Post by Cjkjvfnby » Fri Mar 13, 2015 5:15 am

Comment about current FreeOrion/cmake/make_versioncpp.py

1) Git branches are located in single folder. I suggest to include branch name to version.
2) Git can have unstaged changes. In what case you commit hash will not be same as build. (Looks like with SVN too.)

Should I make a patch?

PS. You don't need to 'project rootdir' for git. (you can construct related path (os.path.join('..', os.path.dirname(__file__)))) But since svn is still in use it cant be removed.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Vezzra
Release Manager, Design
Posts: 4664
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: advance planning for migration to git

#15 Post by Vezzra » Sun Mar 15, 2015 6:16 pm

Cjkjvfnby wrote:1) Git branches are located in single folder. I suggest to include branch name to version.
You mean the name of the currently checked out branch?
2) Git can have unstaged changes. In what case you commit hash will not be same as build. (Looks like with SVN too.)
Yep, this is not different from how things work with SVN now already. We can't cover everything...
Should I make a patch?
Why not? I'd like to see your suggestion.
PS. You don't need to 'project rootdir' for git. (you can construct related path (os.path.join('..', os.path.dirname(__file__))))
I don't understand - how is the make_versioncpp.py script going to locate the files it operates upon? I don't want to rely on all the build environments on all supported platforms to chdir into the project root directory before they call the script. By requiring to pass the project root dir to the script I can make sure we're exactly where we need to be. This has nothing to do with the VCS used.

Post Reply