[clang] [clang-format] Add "three dot" diff option to git-clang-format (PR #74230)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 4 05:44:47 PST 2023


================
@@ -328,6 +337,10 @@ def compute_diff(commits, files, staged):
     git_tool = 'diff-tree'
   elif staged:
     extra_args += ['--cached']
+
+  if len(commits) > 1 and diff_common_commit:
+    commits = [f'{commits[0]}...{commits[1]}']
----------------
owenca wrote:

```suggestion
    git_tool = 'diff-tree'
    if diff_common_commit:
      commits = [f'{commits[0]}...{commits[1]}']
  elif staged:
    extra_args += ['--cached']
```
I would also change line 336 to:
```
if len(commits) == 2:
```

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


More information about the cfe-commits mailing list