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

    <tr>
        <th>Summary</th>
        <td>
            [GitHub] Precommit CI formatter job gives incorrect reproduction command
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Imagine you have multiple commits in a branch.
When code formatter job fails, it gives command to reproduce:
```console
darker --check --diff -r HEAD~1...HEAD path/to/file.py
```
But this is incorrect because locally `HEAD~1...HEAD` is just one commit and formatting issue may be in other commits.
Instead it should produce the following command:
```console
darker --check --diff -r origin/main...HEAD path/to/file.py
```

I suppose this bug is present in all formatters.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUkr1u5DgQhJ-GShojUNTPWIGCsX06O7vsYpJqSbQpUiCbY0xyz37g_MC7G-0CDUhJF7u-KhmjWRziwNpn1r4WMtHqw3BWZ6PJh0L56TK8b3IxDuHiE6zyjLAlS2a3CNpvm6EIxoEEFaTTa8n46d8VHWg_Icw-bJIIA3x4BbM0NjLxAoZgMWeMVwHpJiAPAffgp6SR1SfGT6zjt9HeRW-R8dMkwycGOBz0ivoTDofJzDMcArz9dXr9ryrLMv_ALmllYiTPxDgbi-V--VGP8dNzIqDVRMjjtA8BNYFCLVNEsF5Lay_AOv6TMOt4XvhIkcC7h3nI599tGreAiTEhbPICCjMXTyuGB6gM591FQjllBnH1yU5w9w20ZmDW-q8sdEfz5zR8MItxTIybNO73oeTTIKZ99xFvdFTKdmAPGNHRNWRrvyONZTEN9dTXvSxwqI5t2_ZNJ-piHSrRNeKIshacq0pNupVNjVVdV5NW8xMWZhBctPyp6nlfcVGXuj9qPc8d7-bp6TjPrOG4SWNLa89b6cNSXMEOVduIvimsVGjjtbVCOPy6YWdC5BKHIS8dVFoia7g1keK3DBmy17r_begtKda-wj8B71m-vP_S2FtLvzvyKCkZ7x4JFSnYYSXaY85KjEyMi6E1qVL7jYkxP33_HPbgP1ATE-P14MjEeHd0HsT_AQAA___kayqE">