Page 1 of 2

advance planning for migration to git

Posted: Wed Feb 25, 2015 4:26 pm
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.

Re: advance planning for migration to git

Posted: Wed Feb 25, 2015 5:48 pm
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.

Re: advance planning for migration to git

Posted: Wed Feb 25, 2015 5:52 pm
by o01eg
Mercurial has a local revision numbers.

Re: advance planning for migration to git

Posted: Wed Feb 25, 2015 6:39 pm
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.

Re: advance planning for migration to git

Posted: Wed Feb 25, 2015 6:40 pm
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...

Re: advance planning for migration to git

Posted: Wed Feb 25, 2015 6:41 pm
by Geoff the Medio
Vezzra wrote:git describe
Could you describe git describe?

Re: advance planning for migration to git

Posted: Wed Feb 25, 2015 6:51 pm
by Vezzra
Geoff the Medio wrote:Could you describe git describe?
http://git-scm.com/book/en/v2/Distribut ... ild-Number

Re: advance planning for migration to git

Posted: Thu Feb 26, 2015 10:39 pm
by Chriss
Version number? The version which gets displayed in the bottom right corner of the game?

Re: advance planning for migration to git

Posted: Thu Feb 26, 2015 10:48 pm
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.

Re: advance planning for migration to git

Posted: Fri Feb 27, 2015 8:21 am
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.

Re: advance planning for migration to git

Posted: Fri Feb 27, 2015 1:29 pm
by em3
Git describe seems very sensible.

Re: advance planning for migration to git

Posted: Fri Feb 27, 2015 2:23 pm
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)

Re: advance planning for migration to git

Posted: Thu Mar 12, 2015 12:26 pm
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).

Re: advance planning for migration to git

Posted: Fri Mar 13, 2015 5:15 am
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.

Re: advance planning for migration to git

Posted: Sun Mar 15, 2015 6:16 pm
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.