Clone wiki

pflotran / Developers / CodeDevelopment / ApproachToGit

Approach to Using Git in the Development of PFLOTRAN (Under construction)

PFLOTRAN follows the PETSc workflow for development with Git. Please read over the following links to learn more.

PETSc's Quick Summary

PETSc's Detailed Description

Development big picture

  • PFLOTRAN development will use git branches
    • master : A stable branch.
    • next : A potentially unstable branch that is used for testing a newly developed feature.
    • feature-branch: To develop a new feature.
  • Feature branch
    • Only create one new feature per feature branch
    • Should never start from the next branch.
    • Should routinely start from the master branch. (One could start a feature branch from another feature branch.)
    • Should be named username/my-new-feature (e.g. glenn/general-force-two-phase-state) .
    • Use all lowercase and no underscores in branch name.
    git checkout master
    git checkout -b glenn/general-force-two-phase-state
    • Never merge master or next in your feature branch.
    • If one wants commits that have been merged into master since the feature branch was created, simply rebase your feature branch.
    • When the feature branch is ready to be integrated into the master, issue a pull request and assign a reviewer.
  • Things need to be decided on
    • Commit message template.
    • Merge commit template.

Integrator guide

  1. Merge feature branch into next.
    • Switch to next branch by git checkout next.
    • Update your version of origin/next by git fetch origin.
    • Update your local next with git reset --hard origin/next.
    • Perform the merge of feature branch git merge --no-ff author/branch-name.
    • Push changes to origin by git push origin next.
  2. Let regression tests run with next
    • If there are failures, work with the developer to fix the bug quickly. If the bug can't be fix in a reasonable time, revert the merge commit by git revert <merge-hash> -m 1
    • If there were no failures, proceed to step 3.
  3. Merge feature branch into master.
    • Switch to master branch by git checkout master.
    • Update your version of origin/master by git fetch origin.
    • Update your local master with git reset --hard origin/master.
    • Perform the merge of feature branch git merge --no-ff author/branch-name.
    • Push changes to origin by git push origin master.

PETSc Workflow

The figure below is a graphical depiction of the PETSc workflow provided by the PETSc Developers.

simplified gitworkflows.png