<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/61494>61494</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            git-clang-format-## in LLVM's clang-format-## deb packages do not call the right clang-format version
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          bhennion
      </td>
    </tr>
</table>

<pre>
    
To reproduce:

1. install `clang-format-15` on Ubuntu 20.04 (same with 16, I did not test older versions)
2. Call `git clang-format-15 --diff $SOME_COMMIT`

The resulting patch is wrong (for instance, it does not take into account the option `AllowShortBlocksOnASingleLine: Empty`).
The reason is this (from `git-clang-format-15`):
```
 p.add_argument('--binary',
 default=config.get('clangformat.binary', 'clang-format'),
 help='path to clang-format'),
```
The default binary is `clang-format` instead of `clang-format-15`, thus resulting, on my machine (actually an Azure pipeline) in calling clang-format 11 instead of 15.

As a workaround, one could call `git clang-format-15 --binary=clang-format-15 --diff $SOME_COMMIT`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMlE9v4zYQxT8NdRlIkKg_jg46eOM1sECCHJL2uqDEkcSG4gj8s4H76QvKSuNmt0UBw4apEd9v3jxSOKcmg9ix-gurT4kIfibb9TMao8gkPclLx_ITy48vBBZXSzIMyMrjdfH6XWSgjPNCa2BNPmhhpnQkuwifFjVrciADv_XB-AA8z_IKGL9zYkF4U36GomH8Hr6BVBIMefDoPJCWaOEHWqfIOMbbqxLP4H6XmZSHT1KQplKNIzBePT89fv1-__T4-O2FNfkt7MuMYNEF7ZWZYBV-mEE5eLNkpgg2kr12YwaMYMqDJHRXNPGKoIwnEMNAwXjwMwKtXpGJTEet6e15Juu_aBpe3ZM5PiszaXxQJpoGX5fVXyIQb7NbHOHIRAo_K7dBWFr2JtOf_Yx2_D2BJt8_219YMyHld2GnsKDxjN8xfkjTXhlhL4wfGL_fCyWOImjPytNAZlRTNuFevgle9bLbF-H92Q6zrbYfO86oV1aeGD-sws_gCf6j-hN3tGEngqtmtONTmmKU4mhQSKDx11mLnH4O7mPGcYUMLBdYxDArg9FgMfggtL6AMHD8M1iEVa2o45h4C8rAILSOAblVgKK41S_q7DZYRwcC3si-CkvByKsswkBBy227f0_t7nJ5-r-BzhLZlbItW5FgVzSHtqjqQ9EmcyfGpqoamct2vBMtH_u2r4em5WVf9v1dMyaq4zkv87K4K0pe1G1WNU1d54c8L0VTyLZiVY6LUDrT-seSkZ0S5VzArimqtkq06FG79_vCdrEo7cPkWJVr5bz7eM0rr7H7KcKMl4yX0eOHh98fGT84-NVziT2sYngVEzqQtJ2_zcV45Kya5n8a-X5XJMHqbvZ-dfGI8DPj50n5OfTZQAvj50i3_6SrpT9w8Iyftw4d4-etyb8CAAD___f6mL8">