|
| 1 | +# Contributing to H5CPP |
| 2 | + |
| 3 | +Fixes and contributions are welcome, including external feature branches and pull requests. All contributions are accepted under the MIT license. |
| 4 | + |
| 5 | +## Issue naming |
| 6 | + |
| 7 | +Issues should follow the form: |
| 8 | + |
| 9 | +```text |
| 10 | +<category>, <description> |
| 11 | +``` |
| 12 | + |
| 13 | +Examples: |
| 14 | + |
| 15 | +```text |
| 16 | +ci, add macOS AppleClang runner |
| 17 | +fix, resolve HDF5 discovery on Homebrew |
| 18 | +feature, add compiler metadata contract |
| 19 | +refactor, simplify datatype synthesis |
| 20 | +docs, update migration notes |
| 21 | +``` |
| 22 | + |
| 23 | +Categories: |
| 24 | + |
| 25 | +```text |
| 26 | +fix |
| 27 | +feature |
| 28 | +refactor |
| 29 | +ci |
| 30 | +docs |
| 31 | +test |
| 32 | +legal |
| 33 | +cleanup |
| 34 | +``` |
| 35 | + |
| 36 | +## Branch naming |
| 37 | + |
| 38 | +Feature branches should be created from the current `staging` branch and follow the form: |
| 39 | + |
| 40 | +```text |
| 41 | +<#issue>-<category>-<description> |
| 42 | +``` |
| 43 | + |
| 44 | +Examples: |
| 45 | + |
| 46 | +```text |
| 47 | +138-ci-add-macos-appleclang-runner |
| 48 | +139-fix-hdf5-homebrew-discovery |
| 49 | +140-refactor-datatype-synthesis |
| 50 | +``` |
| 51 | + |
| 52 | +New work should always start from the current `staging` branch: |
| 53 | + |
| 54 | +```bash |
| 55 | +git fetch origin |
| 56 | +git checkout staging |
| 57 | +git pull --ff-only origin staging |
| 58 | +gh issue develop <#issue> --checkout |
| 59 | +``` |
| 60 | + |
| 61 | +If the generated branch name differs from the convention, rename or recreate it before pushing. |
| 62 | + |
| 63 | +## Commit format |
| 64 | + |
| 65 | +Each commit should follow this pattern: |
| 66 | + |
| 67 | +```text |
| 68 | +[#issue]:author:category, description |
| 69 | +``` |
| 70 | + |
| 71 | +Examples: |
| 72 | + |
| 73 | +```text |
| 74 | +[#138]:svarga:ci, add macOS AppleClang runner |
| 75 | +[#139]:svarga:fix, resolve HDF5 discovery on Homebrew |
| 76 | +[#140]:svarga:refactor, simplify datatype synthesis |
| 77 | +``` |
| 78 | + |
| 79 | +Keep commits focused. Prefer several precise commits over one heroic commit that tries to solve the universe and accidentally invents another one. |
| 80 | + |
| 81 | +## Rebase-based development |
| 82 | + |
| 83 | +H5CPP uses a rebase-based feature-branch workflow. Feature branches are carried forward by rebasing onto the current `staging` branch rather than merging `staging` into the feature branch. |
| 84 | + |
| 85 | +Before opening or updating a pull request: |
| 86 | + |
| 87 | +```bash |
| 88 | +git fetch origin |
| 89 | +git checkout <feature-branch> |
| 90 | +git rebase origin/staging |
| 91 | +``` |
| 92 | + |
| 93 | +Resolve conflicts locally, rerun the relevant build and test matrix where possible, then force-push safely: |
| 94 | + |
| 95 | +```bash |
| 96 | +git push --force-with-lease |
| 97 | +``` |
| 98 | + |
| 99 | +Use `--force-with-lease`, not plain `--force`; we are civilized barbarians. |
| 100 | + |
| 101 | +## Pull requests |
| 102 | + |
| 103 | +Once the feature branch is complete, open a pull request targeting `staging`. |
| 104 | + |
| 105 | +A pull request should: |
| 106 | + |
| 107 | +- reference the issue it resolves |
| 108 | +- follow the branch and commit naming convention |
| 109 | +- keep the change scoped to the issue |
| 110 | +- pass the relevant CI jobs |
| 111 | +- document user-visible behavior changes |
| 112 | + |
| 113 | +The preferred merge target for active development is `staging`. Release branches are promoted from `staging` after validation. |
0 commit comments