...
- How to create a patch file:
- The preferred naming convention for Sentry patches is SENTRY
-12345.patch
, or SENTRY-12345-0.001.patch
where12345
is the JIRA number. You might want to name successive versions of the patch something like SENTRY-12345-1.002.patch
, SENTRY-12345-2.003.patch
, etc. as you iterate on your changes based on review feedback and re-submit them. The command to generate the patch is "git diff". Example:
Code Block $ git diff > /path/to/SENTRY-1234-0.001.patch
Read the patch file. Make sure it includes ONLY the modifications required to fix a single issue.
- The preferred naming convention for Sentry patches is SENTRY
- Before you submit your patch:
- Your change should be well-formatted and readable. Please use two spaces for indentation (no tabs).
- Carefully consider whether you have handled all boundary conditions and have provided sufficiently defensive code where necessary.
- Add one or more unit tests, if your change is not covered by existing automated tests. Also add e2e tests if it is a new feature.
- Insert java docs and code comments where appropriate.
- If your patch implements a major feature or improvement, then you must fill in the Release Note field on the issue's Jira with an explanation of the feature that will be comprehensible by the end user.
- Please note that the attachment should be granted license to ASF for inclusion in ASF works (as per the Apache License §5).
Please do not:
- reformat code unrelated to the bug being fixed: formatting changes should be separate patches/commits.
- comment out code that is now obsolete: just remove it.
- make things public which are not required by end users.
Please do:
- comment code whose function or rationale is not obvious;
- name the patch file after the JIRA – SENTRY-<JIRA#>.patch
Running RAT checks
Before submitting your patch, please run RAT check to make sure all the files have the necessary license headers.
To do so, run:
Code Block mvn verify -DskipTests
- How to apply someone else's patch file:
You can apply someone else's patch with the GNU
patch
tool. Example:Code Block $ cd ~/workspace/sentry # or wherever you keep the root of your Sentry source tree $ patch -p1 < SENTRY-1234.0001.patch
- Contributors may variously submit patches in a couple of different formats. If you get some dialog from the
patch
tool asking which file you want to patch, try variously the "-p1" or "-p0" flags topatch
. Without any additional arguments,git diff
generates patches that are applied usingpatch -p1
. If you usegit diff --no-prefix
to generate your patch, you have to apply it usingpatch -p0
. The ReviewBoard tool understands both formats and is able to apply both types automatically.
...