[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.
Loading
Please sign in to comment