Can I get git stat to show me proper-lines-of-code?

129 Views Asked by At

The git stat subcommand (or git log --stat etc.) shows us the numbers of lines added and removed. This is obviously useful, but - sometimes you don't care about whitespace and comment additions and removals.

Is it possible to get git to compute its addition and removal statistics - for display purposes only naturally - other than as lines removed and added? e.g. perhaps run something like cloc on the relevant files?

1

There are 1 best solutions below

0
On

You would not be able to use native Git commands.

Only a third-party could have that kind of additional feature, like cloc you mention.

It was used here, with two checkouts (one for each commits).