@@ -32,8 +32,9 @@ Bug reports and enhancement requests
32
32
33
33
Bug reports are an important part of making *pandas * more stable. Having a complete bug report
34
34
will allow others to reproduce the bug and provide insight into fixing. See
35
- `this stackoverflow article <https://stackoverflow.com/help/mcve >`_ for tips on
36
- writing a good bug report.
35
+ `this stackoverflow article <https://stackoverflow.com/help/mcve >`_ and
36
+ `this blogpost <http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports >`_
37
+ for tips on writing a good bug report.
37
38
38
39
Trying the bug-producing code out on the *master * branch is often a worthwhile exercise
39
40
to confirm the bug still exists. It is also worth searching existing bug reports and pull requests
@@ -246,16 +247,16 @@ changes in this branch specific to one bug or feature so it is clear
246
247
what the branch brings to *pandas *. You can have many shiny-new-features
247
248
and switch in between them using the git checkout command.
248
249
249
- To update this branch, you need to retrieve the changes from the master branch::
250
+ When creating this branch, make sure your master branch is up to date with
251
+ the latest upstream master version. To update your local master branch, you
252
+ can do::
250
253
251
- git fetch upstream
252
- git rebase upstream/ master
254
+ git checkout master
255
+ git pull upstream master --ff-only
253
256
254
- This will replay your commits on top of the latest pandas git master. If this
255
- leads to merge conflicts, you must resolve these before submitting your pull
256
- request. If you have uncommitted changes, you will need to ``stash `` them prior
257
- to updating. This will effectively store your changes and they can be reapplied
258
- after updating.
257
+ When you want to update the feature branch with changes in master after
258
+ you created the branch, check the section on
259
+ :ref: `updating a PR <contributing.update-pr >`.
259
260
260
261
.. _contributing.documentation :
261
262
@@ -293,12 +294,9 @@ Some other important things to know about the docs:
293
294
overviews per topic together with some other information (what's new,
294
295
installation, etc).
295
296
296
- - The docstrings follow the **Numpy Docstring Standard **, which is used widely
297
- in the Scientific Python community. This standard specifies the format of
298
- the different sections of the docstring. See `this document
299
- <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt> `_
300
- for a detailed explanation, or look at some of the existing functions to
301
- extend it in a similar manner.
297
+ - The docstrings follow a pandas convention, based on the **Numpy Docstring
298
+ Standard **. Follow the :ref: `pandas docstring guide <docstring >` for detailed
299
+ instructions on how to write a correct docstring.
302
300
303
301
- The tutorials make heavy use of the `ipython directive
304
302
<http://matplotlib.org/sampledoc/ipython_directive.html> `_ sphinx extension.
@@ -967,32 +965,6 @@ Now you can commit your changes in your local repository::
967
965
968
966
git commit -m
969
967
970
- Combining commits
971
- -----------------
972
-
973
- If you have multiple commits, you may want to combine them into one commit, often
974
- referred to as "squashing" or "rebasing". This is a common request by package maintainers
975
- when submitting a pull request as it maintains a more compact commit history. To rebase
976
- your commits::
977
-
978
- git rebase -i HEAD~#
979
-
980
- Where # is the number of commits you want to combine. Then you can pick the relevant
981
- commit message and discard others.
982
-
983
- To squash to the master branch do::
984
-
985
- git rebase -i master
986
-
987
- Use the ``s`` option on a commit to ``squash``, meaning to keep the commit messages,
988
- or ``f`` to ``fixup``, meaning to merge the commit messages.
989
-
990
- Then you will need to push the branch (see below) forcefully to replace the current
991
- commits with the new ones::
992
-
993
- git push origin shiny-new-feature -f
994
-
995
-
996
968
Pushing your changes
997
969
--------------------
998
970
@@ -1048,15 +1020,51 @@ release. To submit a pull request:
1048
1020
#. Click ``Send Pull Request``.
1049
1021
1050
1022
This request then goes to the repository maintainers, and they will review
1051
- the code. If you need to make more changes, you can make them in
1052
- your branch, push them to GitHub, and the pull request will be automatically
1053
- updated. Pushing them to GitHub again is done by: :
1023
+ the code.
1024
+
1025
+ .. _contributing.update-pr :
1054
1026
1055
- git push -f origin shiny-new-feature
1027
+ Updating your pull request
1028
+ --------------------------
1029
+
1030
+ Based on the review you get on your pull request, you will probably need to make
1031
+ some changes to the code. In that case, you can make them in your branch,
1032
+ add a new commit to that branch, push it to GitHub, and the pull request will be
1033
+ automatically updated. Pushing them to GitHub again is done by::
1034
+
1035
+ git push origin shiny-new-feature
1056
1036
1057
1037
This will automatically update your pull request with the latest code and restart the
1058
1038
:ref:`Continuous Integration <contributing.ci>` tests.
1059
1039
1040
+ Another reason you might need to update your pull request is to solve conflicts
1041
+ with changes that have been merged into the master branch since you opened your
1042
+ pull request.
1043
+
1044
+ To do this, you need to "merge upstream master" in your branch::
1045
+
1046
+ git checkout shiny-new-feature
1047
+ git fetch upstream
1048
+ git merge upstream/master
1049
+
1050
+ If there are no conflicts (or they could be fixed automatically), a file with a
1051
+ default commit message will open, and you can simply save and quit this file.
1052
+
1053
+ If there are merge conflicts, you need to solve those conflicts. See for
1054
+ example at https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/
1055
+ for an explanation on how to do this.
1056
+ Once the conflicts are merged and the files where the conflicts were solved are
1057
+ added, you can run ``git commit`` to save those fixes.
1058
+
1059
+ If you have uncommitted changes at the moment you want to update the branch with
1060
+ master, you will need to ``stash`` them prior to updating (see the
1061
+ `stash docs <https://git-scm.com/book/en/v2 /Git-Tools-Stashing-and-Cleaning>`__).
1062
+ This will effectively store your changes and they can be reapplied after updating.
1063
+
1064
+ After the feature branch has been update locally, you can now update your pull
1065
+ request by pushing to the branch on GitHub::
1066
+
1067
+ git push origin shiny-new-feature
1060
1068
1061
1069
Delete your merged branch (optional)
1062
1070
------------------------------------
0 commit comments