Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Fork the ASF repo

$ $ cd quickstep
  1. cd quickstep

NOTE

Always use "git rebase". Never use "git pull" or "git merge" as that changes the master history and will produce unrelated commit messages for future PRs. 

Work on a new feature

//
  1. Create a JIRA ticket at https://issues.apache.org/jira/browse/QUICKSTEP
, say
  1. . Let's assume the JIRA ticket is identified as: QUICKSTEP-101.
$
  1. git checkout master
$
  1. git checkout -b my-awesome-feature
$
  1. git add some-changed-or-new-files
$
  1. Then test your changes doing at least the following:
    • Check if your code confirms to the code guidelines by running the following command from the root of the quickstep source directory: python third_party/cpplint/lint_everything.py

    • Clear the CMake validation by running the following command from the root of the quickstep source directory: python validate_cmakelists.py
    • Check for cyclic dependencies by running the following command from the root of the quickstep source directory: python cyclic_dependency.py
    • From the build directory, run all the tests using the command: ctest
  2. git commit -m "QUICKSTEP-101:
Added
  1. Add My Awesome Feature."
$
  1. git push origin my-awesome-feature

 

// Sometime we may have Sometimes, there may be code review comments after opening a PR has been opened. $ Address these comments and then do the following: 

  1. git add more-changed-or-new-files
$
  1. git commit -m "Addressed Review Comments."
 

// Finally, once the PR are is ready to merge be merged (i.e. , passing it has passed all the CI teststests and the python validation scripts as described above), // we have need to squash all the commits into one commit. We cherry pick the first commit, // and and squash all the rest .as follows:$

  1. git rebase -i origin/master
//
  1. In the editor,
we would see
  1. you should see smoothing like: 
    //   QUICKSTEP-101:
pick Added
  1. pick Add My Awesome Feature.
    //   pick Addressed Review Comments.
// And we need to
  1. While still in the editor, modify all the content (except to the first line) to "s Addressed Review Comments.".

 

// Check
  1. While still in the editor, check the "Author" field in the last commit with the intended name and email. Amend
them
  1. if needed.
$
  1. Check the git log using: git log
  1.  
$
  1. Now you are ready to push the code. You can do that using: git push origin my-awesome-feature -f

Create a Pull Request (PR) for the new feature

Use the GitHub ASF mirror repo: https://github.com/apache/incubator-quickstep, and set the title for the PR to match the title with of the JIRA ticket.

In this case, QUICKSTEP-101: Added Add My Awesome Feature.

Merge a PR

//

To merge a PR, go through the following steps: 

  1. Update the local fork with the new branch my-awesome-feature.
$
  1. git fetch origin
$
  1. git checkout master
// We should ensure this
  1. Ensure that the PR is one commit
w/
  1. with a well-written commit message.
$
  1. git rebase -i origin/my-awesome-feature
// If
  1. Now if we see "noop", we are good to merge. Otherwise,
// the
  1.  the committer should notify the PR
submitter// to
  1. submitter to rebase the branch to
become
  1. make it a single commit ahead the current master branch.
$
  1. git log
//
  1. If we see a commit message like
// 
  1. "Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-quickstep",
// // It
  1. we should abort the merge; otherwise we will mess up the master history.

 

  1. git push origin master
    This command triggers asfgit to merge the PR in GitHub ASF mirror repo. 
$
  1. git push origin
master
// It
  1. --delete my-awesome-feature
    This command triggers asfgit to delete the merged branch.
$ git push origin --delete my-awesome-feature
//
  1.  
  1. Close the JIRA ticket regarding this PR
.

NOTE

Always use "git rebase". Never use "git pull" or "git merge" as that changes the master history and will produce unrelated commit messages for future PRs. 
  1. by visiting: https://issues.apache.org/jira/browse/QUICKSTEP