Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Author info + smart-apply-patch + gpg wot link

...

Code Block
git log FETCH_HEAD

(Option 1) You can check it out and check the full history:

Code Block
git checkout -b HDDS-1234 FETCH_HEAD

(Option 2) 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

(Option 3) Or you can use the smart-apply patch script from yetus

Code Block
./dev-support/bin/smart-apply-patch GH:562
  • It has additional checks and removes  whitespaces
  • It downloads the different commits one by one and applies to  the current brach (in case of rebase conflict, you can start the review with Option 1)
  • It rewrites the commit history from the PR branch
  • It keeps the number of the commits (no squash marge)

Merge a PR

There are two options to merge a PR to the main branch:

...

Note: the key id should be replaced by the value which is retrieved in the 12nd step of the github tutorial.

Note: github can display a "verified" tag if you upload your public key to the github server. It only means that github verified that you access the email address which is included in the gpg key. If you trust in gihub, it's enough.

If you trust in the member of the Apache community, you should join to the Apache web of trust (people who are already joined are here: https://wot.apache.org/)

Checking the log

Put this one to your ~/.gitconfig

...

I propose not use the sign-off feature, but if you use, please keep the original author of the patch in the sign-off header.

Author information

Developing apache projects is a community effort and we always give credit to the original author of the code. There are two options for this:

(1) Store the author in the author field of the commit

For example if the work is done by Xiaoyu

Code Block
git commit --author="Xiaoyu Yao <xyao@apache.org>"

You can check the author/commit with git log/git show

Code Block
git lg -1   --pretty=fuller --show-signature

* commit 85c9b106de8 (HEAD -> ozone-0.4)
| gpg: Signature made Thu 07 Mar 2019 10:29:08 AM CET
| gpg:                using RSA key 1CEF33FA61800117BDB2E0E0D51EA8F00EE79B28
| gpg: Good signature from "Marton Elek (CODE SIGNING KEY) <elek@apache.org>" [ultimate]
| Author:     Xiaoyu Yao <xyao@apache.org>
| AuthorDate: 10 seconds ago
| Commit:     Márton Elek <elek@apache.org>
| CommitDate: 10 seconds ago

And you can modify the author if it's wrong:

Code Block
git commit --amend --author="Xiaoyu Yao <xyao@apache.org>"

Note: cherry-pick preserver the author ship information but in case of a manual conflict resolution, it's always good practice to check the final author information.

(2) The good old method:

If the email address is not available for you (the patch is attached to the Jira by a non-committer), you can give a credit in the commit message, using the Contributed by postfix:

Code Block
| * f048512bb89 N - HDFS-14192. Track missing DFS operations in Statistics and StorageStatistics. Contributed by Ayush Saxena. (7 weeks ago) <Inigo Goiri> <Inigo Goiri>