Changes between Version 13 and Version 14 of CodingGuidelines/SubmittingPatches


Ignore:
Timestamp:
Jan 14, 2018, 12:47:05 AM (7 years ago)
Author:
waddlesplash
Comment:

Gerrit!

Legend:

Unmodified
Added
Removed
Modified
  • CodingGuidelines/SubmittingPatches

    v13 v14  
    33=== Expressing your desire to work on a ticket ===
    44By default, tickets are assigned to a default component owner. If you wish to work on an assigned ticket, simply comment on the ticket to inform the person. For the most part, this is to reduce the frustration of duplicating work.
     5
     6=== Coding style ===
     7The [http://www.haiku-os.org/development/coding-guidelines Coding Guidelines] are expected to be followed when submitting patches.
     8
     9'''Note:''' When patching existing files that do not follow our Coding Guidelines, it is preferable to apply the stylization to the entire file. If that is not possible, then conform to the pervading style being used.
     10 * [http://dev.haiku-os.org/browser/haiku/trunk/src/tools/checkstyle checkstyle] can be used to help identify violations
     11 * [wiki:CodingGuidelines/VIM] integrate with vim to check style.
     12
     13Be aware, that these style checker tools may generate false positives (eg, evaluating comments as coding violations) or may miss other violations.
    514
    615=== Automatic white space cleanup ===
     
    1221Now, when you save & close a file, any stray spaces at the end of any lines will be automatically removed.
    1322
    14 === Preparing to create patch file ===
     23=== Committing changes ===
     24
    1525 * Before making any commits to the Haiku repository (local even), be sure to [http://www.haiku-os.org/guides/building/get-source-git#configure_env configure the git environment] on your local system! Failure to configure git properly before a commit will result in incorrect naming in your commit and public humiliation on the mailing list.
    1626 * Create patches from within the ''HAIKU_TOP'' directory. This is the directory that contains ''configure'' and typically is the ''haiku/'' or ''buildtools/'' branch.
    17         * {{{ git status }}} will display which files are modified, added, or deleted. Use `git diff` to inspect your changes.
    18         * You'll then have to commit the patch locally by adding the changed or added files (`git add my-file my/new/file`), and then do a `git commit`. You will need to enter a complete commit message that will later appear as is in Haiku's repository if your patch is going to be accepted. The first line of the message is the title that should be as descriptive as possible while not exceeding 50 characters. After an empty line you should add a detailed description what you're trying to fix and how. If you solve a ticket in the bugtracker with it, add a "Fixes #{ticketnumber}" at the end.
    19         * Now, you need to create the actual patch file that you can, for example, attach to a ticket:
    20                 * `git format-patch <commitsha or branch name>` - this will create a file named 0001-your-commit-message.patch. (Note: Depending on your workflow, `git format-patch HEAD~1` may also suffice)
     27        * {{{git status}}} will display which files are modified, added, or deleted. Use `git diff` to inspect your changes.
     28 * You'll then have to commit your changes locally by adding the changed or added files (`git add my-file my/new/file`), and then do a `git commit`.
     29        * You will need to enter a complete commit message that will later appear as is in Haiku's repository if your patch is going to be accepted.
     30        * The first line of the message is the title that should be as descriptive as possible while not exceeding 50 characters.
     31        * After an empty line you should add a detailed description what you're trying to fix and how.
     32        * If you solve a ticket in the bugtracker with it, add a "Fixes #{ticketnumber}." at the end, on its own line.
    2133
    22 === Submitting the patch ===
    23  * Plain text is preferred (not compressed files), as it allows easy viewing within the web browser.
    24  * The [http://www.haiku-os.org/development/coding-guidelines Coding Guidelines] are expected to be followed when submitting patches.
    25         * '''Note:''' When patching existing files that do not follow our Coding Guidelines, it is preferable to apply the stylization to the entire file. If that is not possible, then conform to the pervading style being used.
    26  * [http://dev.haiku-os.org/browser/haiku/trunk/src/tools/checkstyle checkstyle] can be used to help identify violations
    27  * [wiki:CodingGuidelines/VIM] integrate with vim to check style.
    28  * When submitting the patch to a ticket, check the 'patch' check box in the 'Attachment Flags'
    29 Be aware, that these style checker tools may generate false positives (eg, evaluating comments as coding violations) or may miss other violations.
     34=== Submitting your commit(s) ===
     35Create an account on [https://review.haiku-os.org Haiku's Gerrit instance] using your GitHub account, and add your SSH keys.
     36
     37'''Note''': If, after creating an account, you do not have any email addresses attached, please create a ticket under the component {{{Website/Gerrit}}} and specify your GitHub username and the email address you would like the administrators to set for you.
     38
     39'''Note''': Any commits submitted to Gerrit ''must'' have the same email address as is in your Gerrit account, or else Gerrit will reject your submission!
     40
     41Then submit your commits to Gerrit like this:
     42{{{
     43git push origin <local source branch>:refs/for/<remote target branch>
     44}}}
     45Most likely, you are submitting from your local {{{master}}} branch to the remote {{{master}}} branch, in which case you would use:
     46{{{
     47git push origin master:refs/for/master
     48}}}
     49
     50After pushing, either '''create a new ticket about this patch''' or '''comment on the ticket your patch fixes''' with a link to the Gerrit review.
    3051
    3152=== Following up ===