[PATCH] D69323: Add discussion of git-format-patch to Phabricator.html

Kit Barton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 14:40:23 PDT 2019


kbarton created this revision.
kbarton added reviewers: jyknight, delcypher.
Herald added a project: LLVM.

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


Repository:
  rL LLVM

https://reviews.llvm.org/D69323

Files:
  llvm/docs/Phabricator.rst


Index: llvm/docs/Phabricator.rst
===================================================================
--- llvm/docs/Phabricator.rst
+++ llvm/docs/Phabricator.rst
@@ -62,6 +62,33 @@
 * ``git format-patch -U999999 @{u}``
 * ``svn diff --diff-cmd=diff -x -U999999``
 
+Additionally, before sending a patch for review, please also try to ensure it's
+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 upload a new patch:
 
 * Click *Differential*.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69323.226084.patch
Type: text/x-patch
Size: 1266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191022/696630d7/attachment.bin>


More information about the llvm-commits mailing list