Git-commit-rules
از ویکی پارس پویش
(تفاوت بین نسخهها)
(صفحهای جدید حاوی 'Category:Programming <font face ="Tahoma"> __TOC__ <div dir=ltr lang=en> Commit Message Style Template: * Title should be short (50 c...' ایجاد کرد) |
|||
(یک ویرایش میانی توسط یک کاربر نشان داده نشدهاست) | |||
سطر ۵: | سطر ۵: | ||
− | Commit Message Style | + | === '''Commit Message Style''' === |
− | Template: | + | |
+ | '''Template:''' | ||
* Title should be short (50 chars or less) which represents summary of changes followd by a blank line | * Title should be short (50 chars or less) which represents summary of changes followd by a blank line | ||
سطر ۱۵: | سطر ۱۶: | ||
* Further paragraphs come after blank lines. Bullet points are okay, a hyphen is used for the bullet, preceded by a single space, with blank lines in between | * Further paragraphs come after blank lines. Bullet points are okay, a hyphen is used for the bullet, preceded by a single space, with blank lines in between | ||
− | Note: | + | |
+ | '''Note:''' | ||
* Write the summary line and description of what you have done in the imperative mode, that is as if you were commanding someone. Start the line with "Fix", "Add", "Change" instead of "Fixed", "Added", "Changed" | * Write the summary line and description of what you have done in the imperative mode, that is as if you were commanding someone. Start the line with "Fix", "Add", "Change" instead of "Fixed", "Added", "Changed" | ||
سطر ۲۸: | سطر ۳۰: | ||
− | The Things We Should Include in Commit Message: | + | '''The Things We Should Include in Commit Message:''' |
− | + | * Why is this change necessary? This question tells reviewers of your pull request what to expect in the commit, allowing them to more easily identify and point out unrelated changes. | |
− | + | ||
− | + | ||
− | + | * How does it address the issue? Describe, at a high level, what was done to affect change. If your change is obvious, you may be able to omit addressing this question. | |
− | + | ||
− | + | ||
− | + | * What side effects does this change have? This is the most important question to answer, as it can point out problems where you are making too many changes in one commit or branch. One or two bullet points for related changes may be okay, but five or six are likely indicators of a commit that is doing too many things. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | Title Format: | + | '''Title Format:''' |
− | The title should start with commit type | + | * The title should start with commit type (Bugfix/Cleanup/Feature/Customize/Improvement/Doc/Other) followed by a colon and a space and then the summary message. |
− | (Bugfix/Cleanup/Feature/Customize/Improvement/Doc/Other) followed by a | + | e.g: Bugfix: summary message |
− | colon and a space and then the summary message. | + | |
− | message | + | |
− | In cases that the commit is related to a tag id or a branch, the tag | + | * In cases that the commit is related to a tag id or a branch, the tag id or branch name must be mentioned after the commit type followd by a colon. |
− | id or branch name must be mentioned after the commit type followd by a | + | |
− | colon. | + | |
e.g: Bugfix:ref_id: summary message | e.g: Bugfix:ref_id: summary message | ||
− | If the commit resolve an issue or some how is related to it, the | + | * If the commit resolve an issue or some how is related to it, the number of issue should be mentioned in summary message preceded by number sign. |
− | number of issue should be mentioned in summary message preceded by | + | |
− | number sign. | + | |
e.g: Bugfix: summary message issue #234 | e.g: Bugfix: summary message issue #234 |
نسخهٔ کنونی تا ۲۶ اکتبر ۲۰۱۶، ساعت ۱۳:۲۱
محتویات |
[ویرایش] Commit Message Style
Template:
- Title should be short (50 chars or less) which represents summary of changes followd by a blank line
- More detailed explanatory text (description) is followed by the title line, if necessary. It should be wrapped to about 72 characters or so
- Further paragraphs come after blank lines. Bullet points are okay, a hyphen is used for the bullet, preceded by a single space, with blank lines in between
Note:
- Write the summary line and description of what you have done in the imperative mode, that is as if you were commanding someone. Start the line with "Fix", "Add", "Change" instead of "Fixed", "Added", "Changed"
- Always leave the second line blank
- Don't end the summary line with a period; it's a title and titles don't end with a period
- Don't do Two changes in one patch, A commit should contain exactly one logical change; get familiar with `git add -p` and `git add -i` commands
- Don't describe the code, describe the intent and the approach, And keep the log in a present tense
The Things We Should Include in Commit Message:
- Why is this change necessary? This question tells reviewers of your pull request what to expect in the commit, allowing them to more easily identify and point out unrelated changes.
- How does it address the issue? Describe, at a high level, what was done to affect change. If your change is obvious, you may be able to omit addressing this question.
- What side effects does this change have? This is the most important question to answer, as it can point out problems where you are making too many changes in one commit or branch. One or two bullet points for related changes may be okay, but five or six are likely indicators of a commit that is doing too many things.
Title Format:
- The title should start with commit type (Bugfix/Cleanup/Feature/Customize/Improvement/Doc/Other) followed by a colon and a space and then the summary message.
e.g: Bugfix: summary message
- In cases that the commit is related to a tag id or a branch, the tag id or branch name must be mentioned after the commit type followd by a colon.
e.g: Bugfix:ref_id: summary message
- If the commit resolve an issue or some how is related to it, the number of issue should be mentioned in summary message preceded by number sign.