Initial planning. Scheduling migration plan and defining usage in the project
Boleslaw Dawidowicz and Julien Viet
Git has few strenghts over SVN.
In case of GateIn portal project two reasons are currently major ones:
Additionally it will also help for different kind of scenarios where:
GateIn Portal project will be migrated to github. Migration of each project component will be scheduled and the way team cooperates around the source code will be adapted to reuse concepts from git flow.
There won’t be any one time migration effort. GateIn Portal project will first start using git repository for any new component that we introduce. Main requirement for migrating any GateIn code that currently lives in SVN is to preserve commit history. For specific components it may be decided to not migrate all tags and branches fully and rely on read only access to the history in svn.
GateIn Portal will leverage GitHub infrastructure. Organization URL: github.com/gatein
[Table with schedule; Columns - Component; SVN URL; Date; GitHub URL; Person in charge; Comments / Status]
Unlike SVN, GIT allows history rewrite (push --force) and it is important to specify its usage as it is a double edges sword, it has advantages and drawbacks:
Therefore history rewrite usage must be precisely defined
GIT provides several kind of merge possiblities (in a broad sense)
The picture shows what happens with one future and two futures (two futures happens when concurrent modification of the branch is done).
Most of the time we want to identify a JIRA and a feature. In case of GIT, the feature can be made by one or several commits. We will care here about the case where several commits are related to a single JIRA. In order to identify this feature we can consider that those commits are done in a branch and leverage the “merge” commit to add the JIRA in the comment, we have two cases:
Further more the merge commit does not exist and it cannot be labelled with the JIRA (unless we put the same JIRA on each commit of the branch, which is a solution that is error prone). For that matter we should instead make non fast forward merge always in order to distinguish the work done related to the JIRA.
>echo ‘foo’ > main.txt
>git add main.txt
>git commit -m ‘added main.txt’
>git checkout -b bar_feature
>echo ‘bar’ > main.txt
>git add main.txt
>git commit -m ‘changed bar’
>echo ‘bar2’ > main.txt
>git add main.txt
>git commit -m ‘updated bar’
>git checkout master
>git merge --no-ff -m ‘GTNPORTAL-1234’
On the other hand when a single commit resolves a JIRA, it makes more sense to not have a branch. Which can be achieved by a cherry-pick or rebase of that commit onto the HEAD of the branch.
In that case we want to avoid merge and instead keep a linear history as only one single commit is related to the JIRA.
Workflow are an important part of git and play an essential role.
GitHub provides its own set of tools like tracker. GateIn project will still rely on JIRA and aims to reuse as much as it is possible from jboss.org infrastructure. Therefore using tracker or other tools from github i in combination with gatein components is forbidden.
Study pull request mechanism. At least automatic merge of pull request done by GitHub should not be used and instead it should be done manually. I will describe later the difference between a pull request merge and a pull request rebase.
TBD