[PATCH] D91799: [clang-format] State where clang-format-diff.py should be run from

David Spickett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 19 08:31:05 PST 2020


DavidSpickett created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
DavidSpickett requested review of this revision.

At least with git, file paths in a diff will be relative
to the repo root. So if you are in "llvm-project/lldb"
and the diff shows "clang/foo" modified you get:
No such file or directory

>From clang-format-diff.py, since clang-format was
asked to read:
llvm-project/lldb/clang/foo

Add a note to the docs to explain this.

(there is `git diff --relative` but that excludes
changes outside of the current dir)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91799

Files:
  clang/docs/ClangFormat.rst


Index: clang/docs/ClangFormat.rst
===================================================================
--- clang/docs/ClangFormat.rst
+++ clang/docs/ClangFormat.rst
@@ -248,6 +248,9 @@
 The option `-U0` will create a diff without context lines (the script would format
 those as well).
 
+These commands use the file paths shown in the diff output
+so they will only work from the root of the repository.
+
 Current State of Clang Format for LLVM
 ======================================
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91799.306420.patch
Type: text/x-patch
Size: 488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201119/6d962fd4/attachment.bin>


More information about the cfe-commits mailing list