[PATCH] D90996: [clang-format] Add --staged/--cached option to git-clang-format

Mark Lodato via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 21 06:41:15 PDT 2021


lodato requested changes to this revision.
lodato added a comment.
This revision now requires changes to proceed.

Thanks for pushing this through, @ortogonal! The change LGTM, except the two minor issues listed.

Name: Mark Lodato
Email: lodato at google.com



================
Comment at: clang/tools/clang-format/git-clang-format:140
     if not opts.diff:
       die('--diff is required when two commits are given')
   else:
----------------
Does there need to be an equivalent check that --staged requires --diff? Could you test to make sure that works as expected?


================
Comment at: clang/tools/clang-format/git-clang-format:299
   The return value's `stdin` file object will produce a patch with the
-  differences between the working directory and the first commit if a single
+  differences between the working/cached directory and the first commit if a single
   one was specified, or the difference between both specified commits, filtered
----------------
nit: probably more clear to say "working directory (or stage if `staged`)" or something like that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90996/new/

https://reviews.llvm.org/D90996



More information about the cfe-commits mailing list