Skip to content

Instantly share code, notes, and snippets.

@Jako
Last active January 26, 2017 13:02
Show Gist options
  • Save Jako/d00b330341bc8c6ec512cfca92af49ee to your computer and use it in GitHub Desktop.
Save Jako/d00b330341bc8c6ec512cfca92af49ee to your computer and use it in GitHub Desktop.
Revolution Integrators Guide

Few rules

  • Don't merge own PRs
  • Don't do direct changes (submit a PR instead)

GitHub repository setup

  • Clone your fork
  • Add modxcms/revolution as a remote (git remote add upstream git@github.com:modxcms/revolution.git)
  • Update .git/config and add fetch = +refs/pull/*/head:refs/remotes/upstream/pr/* in section [remote "upstream"]
  • Run git fetch upstream

It's a good practise to have 2.5.x and 2.x branch in different folders so you don't have to re-build core & re-run setup each time you switch between those two.

Branches

2.5.x branch represents the upcoming patch release (2.5.X), 2.x branch represents the next significant release (2.X.0). Until 2.x branch diverges, 2.5.x branch is merged to 2.x after merging PRs. After 2.x branch diverges, PRs targeted to 2.5.x needs to be cherry picked to 2.x.

General flow

  • Assign PR to yourself
  • Add PR to milestone
  • Prepare merge/cherry-pick
  • Review code & test functionality
  • Add change log entry
  • Proceed merge/cherry-pick

Merge

Pre-requisite:

  • PR is targeted to correct branch

Prepare merge:

  • git merge --no-ff --no-commit --log upstream/pr/123 (replace 123 with PR ID)

Proceed merge:

  • git add --all (adds change log and all other changed files)
  • git commit (Enter some nice commit message reflecting the change log entry)
  • git push upstream 2.5.x/2.x (pick just 2.5.x or 2.x)

Cherry-pick

Pre-requisite:

  • PR is targeted to wrong branch
  • Develop diverged from master

PR with one commit

Prepare cherry-pick:
  • git cherry-pick -x -n xxxxxxx (replace xxxxxxx with commit hash)
Proceed cherry-pick:
  • git add --all (adds change log and all other changed files)
  • git commit -c xxxxxxx (replace xxxxxxx with commit hash)
  • git push upstream 2.5.x/2.x (pick just 2.5.x or 2.x)

PR with more than one commit

Prepare cherry-pick:
  • git checkout -b branch-name (replace branch-name with reasonable branch name reflecting the PR functionality)

Repeat for each commit:

  • git cherry-pick -x -n xxxxxxx (replace xxxxxxx with commit hash)
  • git commit -c xxxxxxx (replace xxxxxxx with commit hash)
  • git checkout 2.5.x/2.x (choose 2.5.x or 2.x)
  • git merge --no-ff --no-commit --log branch-name (replace branch-name with same name as in first step)

Proceed cherry-pick:

  • git add --all (adds change log and all other changed files)
  • git commit (Enter some nice commit message reflecting the change log entry)
  • git push upstream 2.5.x/2.x (choose 2.5.x or 2.x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment