...
- 'JIRA number + Jira summary' is the first line of the commit
- (if the git author field doesn't contain the author, please add the Contributed by.... text.
- There is only one commit per JIRA issue.
- Commit is signed by the committer (optional, but increase your karma)
- Commit contains the original author in the github git author field (optional, but increase your karma)
...
(4) Push your branch to your own fork
Code Block |
---|
git push youruser HDDS-1234 Enumerating objects: 1220, done. Counting objects: 100% (871/871), done. Delta compression using up to 4 threads Compressing objects: 100% (319/319), done. Writing objects: 100% (683/683), 637.84 KiB | 42.52 MiB/s, done. Total 683 (delta 249), reused 569 (delta 184) remote: Resolving deltas: 100% (249/249), completed with 117 local objects. remote: remote: Create a pull request for 'branchtest' on GitHub by visiting: remote: https://github.com/yoruser/hadoop/pull/new/HDDS-1234 remote: To github.com:elek/hadoop.git * [new branch] branchtest -> branchtest |
...
- Always open a Jira for your PR first
- Use the 'Jira key + summary' as the Title of the PR
- Copy the description from the JIRA (not required, but makes it easy easier to review)
- Put a link to the description back to the JIRA (not required, but makes it easy to check the JIRA
...
Now, you have the PR branch under the FETCH_HEAD reference.
Code Block |
---|
git log FETCH_HEAD |
You can check it out and check the full history:
Code Block |
---|
git checkout -b HDDS-1234 FETCH_HEAD |
Or you can squash it to one commit to merge it to your branch:
Code Block |
---|
git checkout -b HDDS-1234 trunk git merge --squash FETCH_HEAD git status |
...
- Merge it from the github UI (con: can not be signed by the developer, requires gitbox/github integration)
- Merge it with local git magic (con: the merge event is not visible on the ui)
...
Code Block |
---|
commit_jira.sh HDDS-1217 |
It's also a good practice to close the PR from the commit itself. With this approach the final commit will be visible on the PR page:
Just add the "Closes #1234" expression to the end of the commit message in a separated new line:
Code Block |
---|
git commit --amend
HDDS-1213. Support plain text S3 MPU initialization request.
Closes #549
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
|
Signing your commits
It's always a good practice to sign your commits.
...