Skip to content

Commit 6a9b52f

Browse files
committed
doc: Add guide to targeting main and dev branches
1 parent 1bb521b commit 6a9b52f

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,65 @@ consider:
102102
- first checkout your main: `git checkout main`
103103
- then run: `git reset --hard upstream/main`
104104

105+
## Developing for the validator
106+
107+
When proposing a feature or bug fix, you must decide what branch you will target:
108+
`main` or `dev`.
109+
In most cases, you will want `main`, but read below to understand the purposes of
110+
the two branches.
111+
112+
### Branching policy
113+
114+
The BIDS Validator's `main` branch tracks the most recent release version of the specification:
115+
<https://bids-specification.readthedocs.io/en/stable/>.
116+
Pull requests made against the `main` branch should implement features or fix bugs in a way
117+
that preserves consistency with the stable specification.
118+
119+
The `dev` branch is for features that are not yet in the released version of the BIDS
120+
specification.
121+
The purpose of this branch is to verify that proposed rules can be validated and
122+
provide users with preview access to upcoming changes to the validator, increasing the chances
123+
of catching issues with the specification or the validator, prior to release.
124+
Changes to the `dev` branch may be backed out at any time.
125+
126+
### How to prepare a pull request for your target branch
127+
128+
If you're going to target `main`, then start as follows:
129+
130+
```console
131+
git fetch upstream
132+
git switch -c feat/short-desc upstream/main
133+
```
134+
135+
This will create a new branch named `feat/short-desc`
136+
(use `fix/...` for bug-fix branches, `doc/...` for documentation, etc.) starting
137+
from the current state of the `main` branch on the `upstream` remote.
138+
Instead of `short-desc`, use a few words to make the content of your branch
139+
easily identifiable.
140+
141+
Once ready
142+
143+
```console
144+
git push -u origin feat/short-desc
145+
```
146+
147+
GitHub will give you a link, such as
148+
<https://github.com/bids-standard/bids-validator/compare/master...username:bids-validator:feat/short-desc?expand=1>.
149+
Follow that link to create a pull request.
150+
151+
While you are creating the pull request, verify that the base branch is set to `main`.
152+
153+
For `dev`, the process is identical:
154+
155+
```console
156+
git fetch upstream
157+
git switch -c feat/short-desc upstream/dev
158+
# Add your feature
159+
git push -u origin feat/short-desc
160+
```
161+
162+
Open PR, set base branch to `dev`.
163+
105164
[link_git]: https://git-scm.com/
106165
[link_handbook]: https://guides.github.com/introduction/git-handbook/
107166
[link_swc_intro]: http://swcarpentry.github.io/git-novice/

0 commit comments

Comments
 (0)