Goal
- Keep a serialized, linear history of the master branch in the ASF repo.
- Each commit would have a dedicate JIRA ticket, unless the change is trivial.
Fork the ASF repo
$git clone https://git-wip-us.apache.org/repos/asf/incubator-quickstep.git quickstep
cd quickstep
- git submodule update --init
- cd third_party
- ./download_and_patch_prerequisites.sh
NOTE
Work on a new feature
//- Create a JIRA ticket at https://issues.apache.org/jira/browse/QUICKSTEP
- . Let's assume the JIRA ticket is identified as:
QUICKSTEP-101
.
git checkout master
git checkout -b
quickstep-
101
git add some-changed-or-new-files
- 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
- Check for CMake validation errors 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: test -j8
- If you have made changes to the parser to add new tokens and/or grammar rules, please run the script
parser/genfiles.sh
and check the generated files into the directoryparser/preprocessed
.
git commit -m "QUICKSTEP-101: Added My Awesome Feature."
git push origin
quickstep-
// Sometime we may have
101
Sometimes, there may be code review comments after
openinga PR has been opened.
$Address these comments and then do the following:
git add more-changed-or-new-files
git commit -m "Addressed Review Comments."
Finally, once the PR
areis ready to
mergebe merged (i.e.
, passingit has passed all the
CI teststests and the python validation scripts as described above),
//we
haveneed to squash all the commits into one commit. We cherry pick the first commit,
// andand squash all the rest
.as follows:
$git rebase -i origin/master
- In the editor,
- you should see something like:
pick QUICKSTEP-101:
Added My Awesome Feature.
pick Addressed Review Comments.
- While still in the editor, modify the second line to the following.
s Addressed Review Comments.
- While still in the editor, modify the squashed commit messages if needed.
- Check the git log using:
git log.
- Check the
- "Author" field in the last commit with the intended name and email. Amend
- if needed.
$ git log
$ git push origin my-awesome-feature
- Now you are ready to push the code. You can do that using:
git push origin quickstep-101 -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
withof the JIRA ticket.
In this case, QUICKSTEP-101: Added My Awesome Feature
.
Merge a PR
//To merge a PR, go through the following steps:
- Update the local fork with the new
...
...
- branch
quickstep-101
.- If the new branch is in the ASF repo, do
git fetch origin
- Otherwise, we need to fetch from a remote fork repo. Below
some-contributor
is the github id of the contributor, and in the Quickstep github PR, the PR is assumed to have a tag likesome-contributor:quickstep-101
git remote add some-contributor https://github.com/some-contributor/incubator-quickstep.git
git remote -v
git fetch some-contributor quickstep-101
- If the new branch is in the ASF repo, do
- Ensure that the branch / PR is one commit ahead of the
master
branch, with a well-written commit message
...
- :
- If the new branch is in the ASF repo, do the following commands:
git checkout quickstep-101
git rebase -i origin/
- If the new branch is in the ASF repo, do the following commands:
...
master
git push origin quickstep-101 -f
- Otherwise, ask the contributor to do the same as above.
git checkout master
- Rebase the PR with the origin master branch in the ASF repo.
- If the new branch is in the ASF repo,
git rebase -i origin/quickstep-101
- Otherwise,
git rebase -i some-contributor/quickstep-101
Now if
- If the new branch is in the ASF repo,
...
- we see "noop", we are good to merge. Otherwise,
...
- the committer should notify the PR
...
- submitter to rebase the branch to
...
- make it a single commit ahead the current master branch.
...
git log
...
- If we see a commit message like
...
- "
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-quickstep
",
...
- we should abort the merge; otherwise we will mess up the master history.
git push origin master
This command triggersasfgit
to merge the PR in GitHub ASF mirror repo.
...
- Delete the branch if it is in the ASF repo, otherwise skip this step.
git push origin
...
--delete quickstep-101
This command triggersasfgit
to delete the merged branch.
...
NOTE
...
- Close the JIRA ticket regarding this PR by visiting: https://issues.apache.org/jira/browse/QUICKSTEP