[llvm] 06911ae - Add discussion of git-format-patch to Phabricator.html

Kit Barton via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 15:55:07 PST 2019


Author: Kit Barton
Date: 2019-12-03T18:54:46-05:00
New Revision: 06911aee7f86c9dd6ecf16a4b5361fb72f5bc9f1

URL: https://github.com/llvm/llvm-project/commit/06911aee7f86c9dd6ecf16a4b5361fb72f5bc9f1
DIFF: https://github.com/llvm/llvm-project/commit/06911aee7f86c9dd6ecf16a4b5361fb72f5bc9f1.diff

LOG: Add discussion of git-format-patch to Phabricator.html

Summary: There is a discussion of git-format-patch in GettingStarted guide, but no mention of it in the Phabricator.html page.

Reviewers: jyknight, delcypher

Reviewed By: delcypher

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69323

Added: 
    

Modified: 
    llvm/docs/Contributing.rst
    llvm/docs/Phabricator.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/Contributing.rst b/llvm/docs/Contributing.rst
index 67adc45e1dcc..2ad0d9080e12 100644
--- a/llvm/docs/Contributing.rst
+++ b/llvm/docs/Contributing.rst
@@ -45,7 +45,6 @@ you are interested in working on any of these projects, please send a mail to
 the `LLVM Developer's mailing list`_, so that we know the project is being
 worked on.
 
-
 How to Submit a Patch
 =====================
 Once you have a patch ready, it is time to submit it. The patch should:
@@ -55,6 +54,35 @@ Once you have a patch ready, it is time to submit it. The patch should:
 * not contain any unrelated changes
 * be an isolated change. Independent changes should be submitted as separate patches as this makes reviewing easier.
 
+.. _format patches:
+
+Before sending a patch for review, please also try to ensure it is
+formatted properly. We use ``clang-format`` for this, which has git integration
+through the ``git-clang-format`` script. On some systems, it may already be
+installed (or be installable via your package manager). If so, you can simply
+run it -- the following command will format only the code changed in the most
+recent commit:
+
+.. code-block:: console
+
+  % git clang-format HEAD~1
+
+Note that this modifies the files, but doesn't commit them -- you'll likely want
+to run
+
+.. code-block:: console
+
+  % git commit --amend -a
+
+in order to update the last commit with all pending changes.
+
+.. note::
+  If you don't already have ``clang-format`` or ``git clang-format`` installed
+  on your system, the ``clang-format`` binary will be built alongside clang, and
+  the git integration can be run from
+  ``clang/tools/clang-format/git-clang-format``.
+
+
 To get a patch accepted, it has to be reviewed by the LLVM community. This can
 be done using `LLVM's Phabricator`_ or the llvm-commits mailing list.
 Please  follow :ref:`Phabricator#requesting-a-review-via-the-web-interface <phabricator-request-review-web>`

diff  --git a/llvm/docs/Phabricator.rst b/llvm/docs/Phabricator.rst
index ca23ab3f1307..7de8dc1e6a0b 100644
--- a/llvm/docs/Phabricator.rst
+++ b/llvm/docs/Phabricator.rst
@@ -62,6 +62,9 @@ to upload your patch):
 * ``git format-patch -U999999 @{u}``
 * ``svn 
diff  --
diff -cmd=
diff  -x -U999999``
 
+Before uploading your patch, please make sure it is formatted properly, as
+described in :ref:`How to Submit a Patch <format patches>`.
+
 To upload a new patch:
 
 * Click *Differential*.


        


More information about the llvm-commits mailing list