[libcxx-commits] [libcxx] [libc++] Add a merge driver that can apply clang-format (PR #73712)

Bruno De Fraine via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 30 15:41:20 PST 2023


================
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+# This script can be installed in .git/config to allow rebasing old patches across
+# libc++'s clang-format of the whole tree. Most contributors should not require that
+# since they don't have many pre-clang-format patches lying around. This script is to
+# make it easier for contributors that do have such patches.
+#
+# The script is installed by running the following from the root of your repository:
+#
+#   $ git config merge.libcxx-reformat.name "Run clang-format when rebasing libc++ patches"
+#   $ git config merge.libcxx-reformat.driver "libcxx/utils/clang-format-merge-driver.sh %O %A %B %P"
+#   $ git config merge.libcxx-reformat.recursive binary
----------------
brunodf-snps wrote:

This is something from the original script by @nico (who may have copied it from the silly "feel-free merge driver" example in the git documentation) but I'm not too sure about the `recursive binary` setting. According to the documentation, the "recursive" setting applies when this merge driver is used for a merge with multiple common ancestors (for example, a criss-cross merge), and "binary" is for essentially unmergeable files (as binary files typically are, hence the name).

https://github.com/llvm/llvm-project/pull/73712


More information about the libcxx-commits mailing list