Contributing
Please head to our contributing guide in the main repository.
Branching strategy
JabRef has two long-lived branches in two repositories (see ADR-0073):
mainis the development branch. Every pull request targetsmain, unless the change only makes sense for the released version.black-forestin JabRef/jabref-black-forest is the last regular release plus the fixes ported to it. Releases are tagged onblack-forest. It is a long-lived release branch in the terms of Martin Fowler’s branching patterns; fixes are made onmainand cherry-picked, as the hotfix branch pattern recommends.
Getting a fix into the released version
Open the pull request against main as usual. CI adds the label dev: send-to-black-forest when the pull request links an issue of type “bug”: at creation, or when an edit of the description newly links one. Maintainers add or remove the label by hand when the fix should or should not reach users before the next regular release; CI never overrides that decision (a push does not re-add the label). The label triggers two things:
- The check “Would merge into the other branch” simulates the port. If it fails, the fix conflicts with
black-forest; resolve that before or after the merge, as described below. - After the merge, CI (korthout/backport-action) cherry-picks the change into a pull request
[Port to black-forest] ...in JabRef/jabref-black-forest from the branchport-<number>-to-black-forest. A clean port carries theautomergelabel and merges once CI passes. A conflicting port is opened as a draft whose commit contains the conflicting files with Git’s conflict markers (<<<<<<<,=======,>>>>>>>) left in, so the diff shows exactly what needs resolving; the workflow run of the original pull request fails.
A pull request against black-forest is always ported to main the same way, so main never lacks a fix that users have.
Ports are done for the change as merged, so a port pull request must never be labeled dev: send-to-black-forest again.
Resolving a conflicting port
git remote add black-forest https://github.com/JabRef/jabref-black-forest.git # once
git fetch black-forest
git switch -c port-<number>-to-black-forest black-forest/port-<number>-to-black-forest
# resolve the conflict markers, then
git add -A && git commit
git push black-forest HEAD
gh pr ready --repo JabRef/jabref-black-forest <port pull request number>
CHANGELOG.md rarely conflicts: the port merges the added and removed entries of ## [Unreleased] on entry level. Add the changelog entry once, in the branch the pull request targets; do not add it to the port.
Releases (maintainers)
-
Regular release: prepare
CHANGELOG.mdonmainas before (rename## [Unreleased]to the version and add a fresh## [Unreleased]), then mergemainintoblack-forestand tag onblack-forest. Always takemain’sCHANGELOG.mdin that merge; the union merge attribute would otherwise combine both unreleased blocks silently instead of reporting a conflict:git fetch black-forest git switch -c black-forest black-forest/black-forest git merge --no-commit origin/main git checkout origin/main -- CHANGELOG.md git commit git push black-forest black-forest -
Hotfix release: on
black-forest, rename## [Unreleased]to the version, tag, and re-add an empty## [Unreleased]. The port of that commit tomainconflicts by design: insert the version section belowmain’s## [Unreleased]and remove the ported entries from it.