Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added instructions for merging PRs to multiple branches

...

Although you may be asked to rebase or squash your contribution as part of the review process, don't feel the need to do so speculatively. The committer working on merging the contribution may prefer to do these types of operations as part of the merge process, and the history of your patch or pull request may aid in the review process.

Steps to merge/close pull requests with two main branches

As NiFi now has a 1.0 (master) and 0.x (support) branch, pull requests (PR) must be applied to both. Here is a step-by-step guide for committers to ensure this occurs for all PRs.

 

  1. Check out the latest master
    1. $ git checkout master
    2. $ git pull upstream master

 

 

  1. Check out the PR (example #327). This will be in detached-HEAD state. (Note: You may need to edit the .git/config file to add the fetch lines below)
    1. $ git checkout github/pr/327

 

 

  1. Create a branch for the PR
    1. $ git checkout -b pr327

 

 

  1. Apply the changes and sign off. This could be through a commit --amend, rebase, etc.
    1. $ git commit --amend -s
    2. Edit the commit file to contain "This closes #327. "
    3. $ git log
    4. Copy commit id of last commit

 

  1. Switch back to the master branch
    1. $ git checkout master

 

  1. Merge the changes. You can use cherry-pick, merge, etc.
    1. $ git cherry-pick <commit id>

 

  1. (Optional) Ensure the commit was applied successfully
    1. $ git log

 

  1. Push to the Apache repository (master branch)
    1. $ git push apache master

 

  1. Switch to the support branch
    1. $ git checkout -t upstream/0.x

 

  1. (Optional) Check the status of the branch
    1. $ git log

 

  1. Apply the changes from the PR branch
    1. $ git cherry-pick <commit id>

 

  1. Push to the Apache repository (support branch)
    1. $ git push apache 0.x

Anchor
fetch-config
fetch-config
Fetch Config

To ensure you are able to pull the PR directly, add the following lines to your .git/config file.

[remote "github"]
url = git@github.com:apache/nifi.git
fetch = +refs/heads/*:refs/remotes/github/*
fetch = +refs/pull/*/head:refs/remotes/github/pr/*

Code Style

This is a developing standard and will be updated to reflect an agreed upon format further supported by the maven-checkstyle-plugin.  Our current checkstyle rules can be found here.

...