git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[git 2.26] stat counts reported by commit and log are different

From
NKNorbert Kiesel <nkiesel@gmail.com>
Date
Apr 9, 2020, 02:04 UTC
Message-ID
<CAM+g_Nv4UqQNAuYyo5zsTsiomCe4ueoM6ZGU1aqAjLGV9+jQJg@mail.gmail.com>
Hi,
I just noticed that the numbers reported are different:
% git commit -m 'major code cleanup for SCIMPatchOperationUtil'
[nkiesel/nextrelease/SCIM_2 d4db6f6d83f] major code cleanup for
SCIMPatchOperationUtil
 1 file changed, 2106 insertions(+), 3367 deletions(-)
 rewrite utils/SCIMPatchOperationUtil.java (74%)
% git log --stat -1
commit d4db6f6d83f (HEAD -> nkiesel/nextrelease/SCIM_2)
Author: Norbert Kiesel <nkiesel@metricstream.com>
Date:   Wed Apr 8 18:49:27 2020 -0700
    major code cleanup for SCIMPatchOperationUtil
 utils/SCIMPatchOperationUtil.java | 3807
+++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------
 1 file changed, 1273 insertions(+), 2534 deletions(-)
% wc -l utils/SCIMPatchOperationUtil.java
2106 utils/SCIMPatchOperationUtil.java

As you can see, the number of lines in the current file match the number of insertions reported by commit. I suspect some "automated line ending conversion magic" is at fault here (the file has "\r\n" for my Windows-impaired co-developers but I modified it on a Linux system). `git config --get core.autocrlf` on my machine returns `input`. However, I think it would still be better to always report the same numbers, no?

Next: Jeff King
Message 1 of 6 in “[git 2.26] stat counts reported by commit and log are different”
  1. Norbert KieselApr 9, 2020
  2. Jeff KingApr 9, 2020
  3. Norbert KieselApr 9, 2020
  4. Jeff KingApr 9, 2020
  5. Junio C HamanoApr 9, 2020
  6. Jeff KingApr 9, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.