Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
M MEDUSA_4.2.x
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Commits
Collapse sidebar
  • acc
  • MEDUSA_4.2.x
  • Wiki
  • Developing on MEDUSA git Best practice

Last edited by axy Jan 24, 2025
Page history

Developing on MEDUSA git Best practice

  • How to develop MEDUSA, Making best use of git
    • Starting a new dev project on the MEDUSA gitlab
      • first: create a new issue
      • Create a merge request (based on the main branch).
    • Split the work in steps : create your new dev-branch on your main-project branch (rather than the trunk)
      • First, create a new branch :
      • Then, name your new work branch, and create it.
      • Next, create a merge-request for this branch :
    • Now you're good to work!

How to develop MEDUSA, Making best use of git

Here are some hints to develop MEDUSA with git.
in the following how-to page, you'll be shown how to create your own branches and 'issues' that will help you develop and trac your changes.

Imagine you have a bugfix or a whole new component to add in MEDUSA.

Starting a new dev project on the MEDUSA gitlab

first: create a new issue

image (i know you're not necessarily facing an issue, but that's how git calls it...)
The issue creates a page that will be linked to your development, where you can describe what you plan to do, why, the different steps to do it,...

Create a merge request (based on the main branch).

Creating merge request will also create your development branch associated to this merge request.
If we take my biopole work for example :
image
You can see your merge request:
image

Split the work in steps : create your new dev-branch on your main-project branch (rather than the trunk)

To make the coding easier, and for you to have a better idea of what you've done,
you might want to split your work in 3 or 4 stages.
For example, for my diapause work :

  • 1- stage was in 1D to move the mesozoo at depth and back up depending of the time of year, and change the metabolism once at depth.
  • 2- Let the mesozoo bring some Carbon at depth with them (as if they had made some stocks of fat for the winter)
  • 3- move to 3D, adapt the diapause and wake up timings to the 3D...

For this, you might want to do a separated branch for each stage, based on the merged request branch (your "main" project branch), that you'll merge back to once the work is done. In my case, i'll base my next development branch (biopole-diapause-C-stock) on the my "main" Diapause branch (biopole-diapause-work) :

This is done this way :

First, create a new branch :

image Then still based on my diapause work example.
I want to create a branch based on my previous Diapause work (already on the diapause branch), that will only contain the next stage work. image

Then, name your new work branch, and create it.

image

Next, create a merge-request for this branch :

-- Gitlab suggests it straight away :
image

But, in case you missed it, you can still do it.
Go to merged request, and... well, gitlab got updated, it does remember! image

Once you click on "create merge request", beware to ask to merge you work branch onto your main project branch: image

And change the target branch :
image

Then you can finalize you merge request : image

Now you're good to work!

But don't forget to work on your new branch :
From the main directory of your checked-out MEDUSA-git :

  1. Check there is no work done on the branch you're on, that you might have forgotten to commit, with "git status"
  2. Then, once you're sure nothing is left un-commited, make sure your branch is up-to-date, and knows about your newly created branch with "git pull".
  3. Now you can switch to the new branch with "git switch ${branch-name}"
  4. And from there, you should be ready to develop on your new branch. image

Hope that helps!

Clone repository
  • Compile MEDUSA from scratch
  • Developing on MEDUSA git Best practice
  • How to SETTE test MEDUSA.
  • How to run MEDUSA 1D on ARCHER2 and ANEMONE
  • How to run on ANEMONE
  • How to run on ARCHER2
  • MEDUSA DOCU : Chl light
  • MEDUSA DOCU : Rivers
  • MEDUSA Guide some useful explanations
  • MEDUSA NEMO4.2
  • MEDUSA Training How to run MEDUSA 1D ( on NOC linux system)
  • Home
  • todo_list