[PATCH] D24319: clang-format: Add a flag to limit git-clang-format's diff to a single commit

Luis Héctor Chávez via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 12 23:30:05 PDT 2016


lhchavez marked 2 inline comments as done.

================
Comment at: cfe/trunk/tools/clang-format/git-clang-format:323
@@ -312,1 +322,3 @@
 
+def create_tree_from_commit(commit, filenames):
+  """Create a new git tree with the given files from `commit`.
----------------
lhchavez wrote:
> lodato wrote:
> > Unless I'm mistaken, this function is unnecessary. There is no need to filter out files in the tree that do not match the pattern, since the filtering happens in `compute_diff()` (`cmd.extend(files)`).
> The reason I added this is to prevent the generation of much larger temporary indices for large projects (like Chromium) vs. git-clang-format in normal mode. I can add a comment explaining that.
Wait, I understand what you mean now. I can just extract the tree from the commit and use that as diff base. Changed it to a simpler `git show` command.


https://reviews.llvm.org/D24319





More information about the cfe-commits mailing list