From 6cb9bef1c962d9c249756bc5de1f7ca890bc58ab Mon Sep 17 00:00:00 2001 From: jennyhickson <61183013+jennyhickson@users.noreply.github.com> Date: Mon, 23 Mar 2026 09:07:10 +0000 Subject: [PATCH 1/2] first draft --- .../WorkingPractices/maintaining_branches.rst | 187 ++++++++++++++++++ source/WorkingPractices/maintaining_forks.rst | 96 --------- source/WorkingPractices/working_practices.rst | 1 + 3 files changed, 188 insertions(+), 96 deletions(-) create mode 100644 source/WorkingPractices/maintaining_branches.rst diff --git a/source/WorkingPractices/maintaining_branches.rst b/source/WorkingPractices/maintaining_branches.rst new file mode 100644 index 00000000..1634c55a --- /dev/null +++ b/source/WorkingPractices/maintaining_branches.rst @@ -0,0 +1,187 @@ +.. ----------------------------------------------------------------------------- + (c) Crown copyright Met Office. All rights reserved. + The file LICENCE, distributed with this code, contains details of the terms + under which the code may be used. + ----------------------------------------------------------------------------- + +.. _maintaining_branches: + +Maintaining Branches +==================== + +Simulation Systems repositories use version branches to aid in scientific +evaluation and testing. This means that all new branches should be taken from a +release and should not be updated with the latest changes on ``main`` until +ready to be merged. Exceptions can be made for changes that are specifically +building on changes already merged since the last release. + +Developments that take longer than one release cycle can be upgraded to the +new release when convenient, and should be upgraded before opening a pull +request. + +.. _upgrading_to_release: + +Upgrading to a release +---------------------- +There are two main ways to upgrade your branch to a new release. If you are +developing the same change in parallel at different versions then you may wish +to create a new branch from latest release and merge the old changes into this. +Otherwise we would recommend merging the release from ``stable`` into your branch. + +In both cases we recommend use of tagging to mark the changes on your branch for +including in suites at different versions. This will give a human-readable +identifier to make it clear which version the suite user is including. Tags can +be applied retrospectively if needed, and can be used as a branch point if +development is needed at an older revision. Tags can also be moved to track +the latest developments. + +Below are an example set of commands for both cases. There are many ways to +achieve the same result so see the sections on +:ref:`Synchronise your fork` and +:ref:`Updating a branch` for more details. + +.. tab-set:: + + .. tab-item:: Merging in Stable + + #. tag latest commit on branch to mark the latest developments at the old release + #. update stable branch in fork + #. fetch that into clone + #. merge stable into branch + #. push + + + .. tab-item:: Creating a New Branch + + #. update stable branch in fork + #. fetch that into clone + #. create branch from stable + #. merge old development branch into new development branch + #. tag both? + + +.. important:: + Do not use ``git rebase`` to upgrade your branch to the latest release. This + rewrites the history of the branch and makes it impossible for suites to + include your changes at a previous release. + +.. admonition:: Tagging + + Tagging gives a human-readable label to a specific commit. You are free + to apply whatever tags you wish within your fork of a repository. + + .. code-block:: + + git tag -a