[all-commits] [llvm/llvm-project] 191a39: [git-clang-format] Add --diffstat parameter

Roland via All-commits all-commits at lists.llvm.org
Fri Oct 15 01:57:11 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 191a395343b984d26d058c449cefe1a9ac0ff927
      https://github.com/llvm/llvm-project/commit/191a395343b984d26d058c449cefe1a9ac0ff927
  Author: Roland Fischer <roli at gugus.ca>
  Date:   2021-10-15 (Fri, 15 Oct 2021)

  Changed paths:
    M clang/tools/clang-format/git-clang-format

  Log Message:
  -----------
  [git-clang-format] Add --diffstat parameter

[git-clang-format][PR46815] Add diffstat functionality

Adding a --diffstat parameter to git-clang-format that essentially uses git diff --stat, i.e. lists the files needing
formatting. This is useful for CI integration or manual usage where one wants to list the files not properly formatted.

I use it for the Suricata project's github action (CI) integration that verifies proper formatting of a pull request
according to project guidelines where it's very helpful to say which files are not properly formatted. I find the list
of files much more useful than e.g. showing the diff in this case using git-clang-format --diff.

An alternative would be to take an additional parameter to diff, e.g. git-clang-format --diff --stat

The goal is not to provide the whole git diff --stat=... parameter functionality, just plain git diff --stat.

Reviewed By: MyDeveloperDay, JakeMerdichAMD

Differential Revision: https://reviews.llvm.org/D84375




More information about the All-commits mailing list