The number of lines of code obtained by git log and gitlab api is very different

The git api is fetched this way:

curl --header “PRIVATE-TOKEN: <your_access_token>” “

The git log is fetched this way:

$ git log --author=“$(git config --get” --pretty=tformat: --numstat | gawk ‘{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf “added lines: %s removed lines : %s total lines: %s\n”,add,subs,loc }’ -

The different is :

If this file ‘package-lock.json’ is include , git api will count the number of lines of code, but git log will not count it, but treat it as a binary file.