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 and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

advance planning for migration to git

#1 Post by Dilvish »

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 »

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
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: advance planning for migration to git

#3 Post by o01eg »

Mercurial has a local revision numbers.
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-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: advance planning for migration to git

#4 Post by Vezzra »

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: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: advance planning for migration to git

#5 Post by Vezzra »

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: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: advance planning for migration to git

#6 Post by Geoff the Medio »

Vezzra wrote:git describe
Could you describe git describe?

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

Re: advance planning for migration to git

#7 Post by Vezzra »

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 »

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: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: advance planning for migration to git

#9 Post by Geoff the Medio »

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: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: advance planning for migration to git

#10 Post by Vezzra »

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: 630
Joined: Sun Sep 25, 2011 2:51 pm

Re: advance planning for migration to git

#11 Post by em3 »

Git describe seems very sensible.
https://github.com/mmoderau
[...] 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: 539
Joined: Tue Jun 24, 2014 9:55 pm

Re: advance planning for migration to git

#12 Post by Cjkjvfnby »

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: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: advance planning for migration to git

#13 Post by Vezzra »

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: 539
Joined: Tue Jun 24, 2014 9:55 pm

Re: advance planning for migration to git

#14 Post by Cjkjvfnby »

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: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: advance planning for migration to git

#15 Post by Vezzra »

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