You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SUBMITTING_PATCHES 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. Short Version:
  2. - Make small logical changes.
  3. - Provide a meaningful commit message.
  4. - Review and follow the Eclipse Due Diligence Process
  5. http://www.eclipse.org/projects/dev_process/ip-process-in-cartoons.php
  6. http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf
  7. - Review and follow the current guidelines:
  8. http://wiki.eclipse.org/EGit/Contributor_Guide
  9. Long Version:
  10. I wanted a file describing how to submit patches for JGit,
  11. so I started with the one found in the core Git distribution
  12. (Documentation/SubmittingPatches), which itself was based on the
  13. patch submission guidelines for the Linux kernel.
  14. However there are quite a few differences, so please review and
  15. familiarize yourself with the following relevant bits:
  16. (1) Make separate commits for logically separate changes.
  17. Unless your patch is really trivial, you should not be sending
  18. out a patch that was generated between your working tree and your
  19. commit head. Instead, always make a commit with complete commit
  20. message and generate a series of patches from your repository.
  21. It is a good discipline.
  22. Describe the technical detail of the change(s).
  23. If your description starts to get too long, that's a sign that you
  24. probably need to split up your commit to finer grained pieces.
  25. I am very picky about formatting. Make sure your final version
  26. of every file was formatted using the Eclipse code formatter
  27. using the project specific settings (Properties->Java Code
  28. Style->Formatter->"Java Conventions [built-in]").
  29. (2) Generate your patch using git tools out of your commits.
  30. git based diff tools (git, and StGIT included) generate unidiff,
  31. which is the only acceptable format.
  32. You do not have to be afraid to use -M option to "git diff" or "git
  33. format-patch", if your patch involves file renames. The receiving
  34. end can handle them just fine.
  35. Please make sure your patch does not include any extra files which
  36. do not belong in a patch submission. Make sure to review your
  37. patch after generating it, to ensure accuracy. Before sending out,
  38. please make sure it cleanly applies to the "master" branch head.
  39. (3) Check the license.
  40. JGit is licensed under the Eclipse Distribution License (EDL,
  41. http://www.eclipse.org/org/documents/edl-v10.html), which is a
  42. renamed version of the new style/3-clause BSD license.
  43. Under this licensing model *every* file within the project
  44. *must* list which license covers it in the header of the file.
  45. Any new contributions to an existing file *must* be submitted under
  46. the current license of that file. Any new files *must* clearly
  47. indicate which license they are provided under in the file header.
  48. Please verify that you are legally allowed and willing to submit your
  49. changes under the license covering each file *prior* to submitting
  50. your patch. It is virtually impossible to remove a patch once it
  51. has been applied and pushed out.
  52. (4) Review the Eclipse Due Diligence Process.
  53. http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf
  54. (5) Sending your patches.
  55. "git format-patch" command follows the best current practice to
  56. format a commit as a reviewable text message.
  57. At the beginning of the patch should come your commit message,
  58. a line that consists of three dashes, followed by the diffstat
  59. information and the patch itself. If you are forwarding a patch
  60. from somebody else, optionally, at the beginning of the e-mail
  61. message just before the commit message starts, you can put a "From:
  62. " line to name that person.
  63. You often want to add additional explanation about the patch,
  64. other than the commit message itself. Place such "cover letter"
  65. material between the three dash lines and the diffstat, or please
  66. place it in the bug description itself.
  67. Open a new bug on the Eclipse bug tracker on the EGit project:
  68. https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EGit
  69. Attach the mailbox file(s) created by "git format-patch" to the bug.