Updated almost 12 years ago by Knödlseder Jürgen
Central repository workflow for maintainers¶
This page describes the integration workflow for maintainers. In summary, the following steps are to be executed:- Clone central GammaLib repository
- Integrate feature branch
- Verify the integration
- Merge feature into devel
- Delete the feature branch
Clone central GammaLib repository¶
As first step, a clone of the central GammaLib repository is needed:
$ git clone https://manager@cta-git.irap.omp.eu/gammalib Cloning into 'gammalib'... Password: remote: Counting objects: 22150, done. remote: Compressing objects: 100% (7596/7596), done. remote: Total 22150 (delta 17330), reused 18491 (delta 14497) Receiving objects: 100% (22150/22150), 80.12 MiB | 192 KiB/s, done. Resolving deltas: 100% (17330/17330), done.where
manager
is the user name of the integration manager.
Integrate feature branch¶
Rebase or merge¶
If there are only a few commits, consider rebasing to upstream:
$ git checkout 007-my-new-feature $ git fetch origin $ git rebase origin/devel
If there are a longer series of related commits, consider a merge instead:
$ git checkout 007-my-new-feature $ git merge --no-ff origin/develNote the
--no-ff
above. This forces git to make a merge commit, rather than doing a fast-forward, so that these set of commits branch off devel
then rejoin the main history with a merge, rather than appearing to have been made directly on top of devel
.
Check the history¶
Now, in either case, you should check that the history is sensible and you have the right commits:
$ git log --oneline --graph $ git log -p origin/devel..The first line above just shows the history in a compact way, with a text representation of the history graph. The second line shows the log of commits excluding those that can be reached from
devel
(origin/devel
), and including those that can be reached from current HEAD (implied with the ..
at the end). So, it shows the commits unique to this branch compared to devel
. The -p
option shows the diff for these commits in patch form.
Merge into integration branch¶
Now it’s time to merge the feature branch in the integration
branch:
$ git checkout integration Branch integration set up to track remote branch integration from origin. Switched to a new branch 'integration' $ git merge 007-my-new-feature Updating ccba491..623d38d Fast-forward .gitignore | 20 ++++++++--- pyext/GDerivative.i | 77 +++++++++++++++++++++++++++++++++++++++++++++ pyext/GFunction.i | 46 +++++++++++++++++++++++++++ pyext/gammalib/numerics.i | 2 + 4 files changed, 139 insertions(+), 6 deletions(-) create mode 100644 pyext/GDerivative.i create mode 100644 pyext/GFunction.i $ git push origin integration Password: Counting objects: 7, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 392 bytes, done. Total 4 (delta 3), reused 0 (delta 0) remote: To https://github.com/gammalib/gammalib.git remote: ccba491..623d38d integration -> integration remote: 065af59..8c6cc48 github/007-my-new-feature -> github/007-my-new-feature To https://jknodlseder@cta-git.irap.omp.eu/gammalib ccba491..623d38d integration -> integration
Verify the integration¶
The push
will automatically launch the integration pipeline on Jenkins.
You should verify the all checks are passed with success.
Merge feature into devel¶
Once the new feature is validated, merge the feature in the devel
branch:
$ git checkout devel Switched to branch 'devel' $ git merge integration Updating cb9b2fe..623d38d Fast-forward pyext/GFunction.i | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) $ git push origin Total 0 (delta 0), reused 0 (delta 0) remote: To https://github.com/gammalib/gammalib.git remote: cb9b2fe..623d38d devel -> devel remote: ccba491..623d38d github/integration -> github/integration To https://jknodlseder@cta-git.irap.omp.eu/gammalib cb9b2fe..623d38d devel -> devel
Delete the feature branch¶
$ git checkout devel Already on 'devel' $ git branch -D 007-my-new-feature Deleted branch 007-my-new-feature (was 816ac2c). $ git push origin :007-my-new-feature Password: remote: To https://github.com/gammalib/gammalib.git remote: - [deleted] 007-my-new-feature remote: cb9b2fe..623d38d github/devel -> github/devel To https://jknodlseder@cta-git.irap.omp.eu/gammalib - [deleted] 007-my-new-featureNote the colon : before
007-my-new-feature
. See also: http://github.com/guides/remove-a-remote-branch