[PATCH] D41129: Fix `git-clang-format <commit1> <commit2>`.

Mark Lodato via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 12 13:11:45 PST 2017


lodato created this revision.
lodato added reviewers: djasper, klimek.

This feature had never worked at all because the code incorrectly used <`commit2>` for both the "old" and "new", so the diff was always empty! Now we correctly use `<commit1>` where we should and it works fine.


https://reviews.llvm.org/D41129

Files:
  google3/third_party/llvm/llvm/tools/clang/tools/clang-format/git-clang-format


Index: google3/third_party/llvm/llvm/tools/clang/tools/clang-format/git-clang-format
===================================================================
--- google3/third_party/llvm/llvm/tools/clang/tools/clang-format/git-clang-format
+++ google3/third_party/llvm/llvm/tools/clang/tools/clang-format/git-clang-format
@@ -153,7 +153,7 @@
   # those files.
   cd_to_toplevel()
   if len(commits) > 1:
-    old_tree = commits[1]
+    old_tree = commits[0]
     new_tree = run_clang_format_and_save_to_tree(changed_lines,
                                                  revision=commits[1],
                                                  binary=opts.binary,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41129.126611.patch
Type: text/x-patch
Size: 659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171212/5cd0b332/attachment.bin>


More information about the cfe-commits mailing list