CLOC diff (count line of code) with git header

4k views Asked by At

im trying to check lines of code using diff in the git repository with last commit and HEAD, but there's an error showing up,

$ cloc -- diff 182712379cae1b953c5976854e735134530e8241 HEAD

Error:

0 text files.

0 text files.

0 files ignored.

2 errors: Unable to read: 182712379cae1b953c5976854e735134530e8241

Unable to read: HEAD

Nothing to count.

2

There are 2 answers

1
AlDanial On

You'll need to add the --git switch otherwise cloc will think HEAD is the name of a file or directory.

6
AlDanial On

Both --git and --diff:

cloc --git --diff 18271237 HEAD