| :orphan: |
|
|
| .. _basic-workflow: |
|
|
| **************** |
| Creating patches |
| **************** |
|
|
| Overview |
| ======== |
|
|
| If you haven't already configured git:: |
|
|
| git config |
| git config |
|
|
| Then, the workflow is the following:: |
|
|
| |
| git clone |
|
|
| |
| cd astropy |
| git branch the-fix-im-thinking-of |
| git checkout the-fix-im-thinking-of |
|
|
| |
|
|
| |
| git add somewhere/tests/test_my_bug.py |
|
|
| |
| git commit -am 'BF - added tests for Funny bug' |
|
|
| |
|
|
| |
| git commit -am 'BF - added fix for Funny bug' |
|
|
| |
| git format-patch -M -C master |
|
|
| Then, send the generated patch files to the `astropy-dev mailing list`_ |emdash| |
| where we will thank you warmly. |
|
|
| In detail |
| ========= |
|
|
| |
| made:: |
|
|
| git config |
| git config |
|
|
| This is only necessary if you haven't already done this, and you haven't |
| checked to :ref:`check_git_install`. |
|
|
| |
| Astropy_ repository:: |
|
|
| git clone |
| cd astropy |
|
|
| |
| nice and safe and leaves you with access to an unmodified copy of the code |
| in the main branch:: |
|
|
| git branch the-fix-im-thinking-of |
| git checkout the-fix-im-thinking-of |
|
|
| |
|
|
| |
|
|
| |
| git add somewhere/tests/test_my_bug.py |
|
|
| |
| git commit -am 'BF - added tests for Funny bug' |
|
|
| |
|
|
| |
| git commit -am 'BF - added fix for Funny bug' |
|
|
| Note the ``-am`` options to ``commit``. The ``m`` flag just |
| signals that you're going to type a message on the command |
| line. The ``a`` flag |emdash| you can just take on faith |emdash| |
| or see `why the -a flag?`_. |
|
|
| |
|
|
| git status |
|
|
| |
| branched from the ``master`` branch:: |
|
|
| git format-patch -M -C master |
|
|
| You will now have several files named for the commits:: |
|
|
| 0001-BF-added-tests-for-Funny-bug.patch |
| 0002-BF-added-fix-for-Funny-bug.patch |
|
|
| Send these files to the `astropy-dev mailing list`_. |
|
|
| When you are done, to switch back to the main copy of the |
| code, just return to the ``master`` branch:: |
|
|
| git checkout master |
|
|
| .. include:: links.inc |
|
|