66 | | These commands could be used for any Git project, modular or not, so hopefully you are already somewhat familiar with them: |
| 65 | {{{ |
| 66 | >git status |
| 67 | # On branch develop |
| 68 | nothing to commit, working directory clean |
| 69 | }}} |
| 70 | |
| 71 | === Fix a simple bug === |
| 72 | |
| 73 | For simple bugs, particularly in projects with a single maintainer, it is common practice to fix bugs directly in the {{{develop}}} branch. Creating a test case with your favorite editor, testing the test case, fixing the bug, testing the fix, and then iterating if necessary is no different than with any programming environment. |
| 74 | |
| 75 | Once the fix is complete, you then commit the fix locally and push from your local repo up to your public boostorg repo on GitHub. These same commands would be used for any Git project, modular or not, so hopefully you are already somewhat familiar with them: |
| 85 | Fixing a bug directly on the {{{develop}}} branch is fine, if that's the policy for the library, but if the bug is messy, multiple maintainers are involved, interruptions are expected, or other complexities are present, then it is better practice to work on the bug in a separate bug-fix branch. |
| 86 | |
| 87 | {{{ |
| 88 | git checkout bugfix/complex-boo-boo |
| 89 | }}} |
| 90 | |
| 91 | This creates the branch {{{bugfix/complex-boo-boo}}}, and switches to it. Incidentally, "bugfix/" is part of the name, not a directory specifier. Because we were on branch {{{develop}}}, {{{develop}}} is what the new branch is based on. Since the bug is complex, it may take some time to fix, and the developer might go through several cycles of fixes, tests, and commits. |
| 92 | |
| 93 | So far, {{{bugfix/complex-boo-boo}}} is a private branch since it has not been pushed up to the public GitHub repo. To share work-in-progress with others or to create backup: |
| 94 | |
| 95 | {{{ |
| 96 | git push |
| 97 | }}} |
| 98 | |
| 99 | Now the branch is public and can be seen by others. |
| 100 | |
| 101 | Eventually the bug is fixed, so it is time to merge the {{{bugfix/complex-boo-boo}}} branch back into {{{develop}}}: |
| 102 | |
| 103 | {{{ |
| 104 | }}} |
| 105 | |