Skip to content
Commit 0bd6be9c authored by Nico Weber's avatar Nico Weber
Browse files

[gn build] Fix sync script on renames like "Foo.cpp" -> "LLVMFoo.cpp"

Before, the script used `git log -SFoo.cpp` to find a commit where
the number of occurrences of "Foo.cpp" changed -- but since
a patch with

  + LLVMFoo.cpp
  - Foo.cpp

contains the same number of instances of "Foo.cpp", the script
incorrectly skipped this type of rename.

As fix, look for '\bFoo\.cpp\b' instead and pass --pickaxe-regex
so that we can grep for word boundaries.

To test, check out 7531a503 (which renamed in llvm/lib/IR
RemarkStreamer.cpp to LLVMRemarkStreamer.cpp) and look at the output of
the script.  Before this change, it correctly assigned the addition
of LLVMRemarkStreamer.cpp to 7531a503 but incorrectly assigned
the removal of RemarkStreamer.cpp to b8a847c0.  With this, it
correctly assigns both to 7531a503.
parent 5ee4a03b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment