...
- '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 the original author in the github author field (optional, but increase your karma)
Open a PR
To open a PR:
(1) clone the hadoop repository (with clicking the fork button at https://github.com/apache/hadoop)
...
- 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 to review)
- Put a link to the description back to the JIRA (not required, but makes it easy to check the JIRA
Trying out a PR locally
The easiest way to check out a PR locally is fetch by the id:
...
Code Block |
---|
git merge --squash FETCH_HEAD git status |
Merge a PR
There are two options to merge a PR to the main branch:
- Merge it from the github UI (con: can not be signed by the developer)
- Merge it with local git magic (con: the merge event is not visible on the ui)
With UI
Note: this step (and only this step) requires a binding between your github account and apache account, which can be done here: https://gitbox.apache.org/setup/
...
(3) Double check the commit message and commit it:
With CLI
The easy way was mentioned before:
...
Code Block |
---|
commit_jira.sh HDDS-1217 |
Signing your commits
It's always a good practice to sign your commits.
...
Note: the key id should be replaced by the value which is retrieved in the 12nd step of the github tutorial.
Checking the log
Put this one to your ~/.gitconfig
...
Code Block |
---|
git show HEAD --pretty=fuller --show-signature commit ade31258e6275ba3bf7e642b24f8e865dd32f640 (HEAD -> branchtest, elek/branchtest) gpg: Signature made Wed 06 Mar 2019 11:53:17 AM CET gpg: using RSA key 1CEF33FA61800117BDB2E0E0D51EA8F00EE79B28 gpg: Good signature from "Marton Elek (CODE SIGNING KEY) <elek@apache.org>" [ultimate] Author: Márton Elek <elek@apache.org> AuthorDate: Wed Mar 6 11:53:17 2019 +0100 Commit: Márton Elek <elek@apache.org> CommitDate: Wed Mar 6 11:53:17 2019 +0100 HDDS-1234. This is just an example commit. diff --git a/asd b/asd new file mode 100644 index 00000000000..e69de29bb2d |
About sign-off
Sign-off is an additional line in the git commit message (this is not the same as a cryptographic signature). This is required for the linux kernel development.
...