Search code examples
gitgit-log

git log --numstat has weird data


I run this command:

git log HEAD --numstat --pretty="%ae" | cat

and I see this:

6       4       frontend/src/Frontend.hs
aviansys@gmail.com
dan.side@gmail.com
dan.side@avian.systems

3       3       dep/rhyolite/github.json
29      14      frontend/src/Frontend.hs
aviansys@gmail.com

3       1       backend/src/Backend/RequestHandler.hs
27      18      frontend/src/Frontend.hs
dan.side@avian.systems

5       0       default.nix
7       0       dep/reflex-dom/default.nix
7       0       dep/reflex-dom/github.json
7       0       dep/reflex/default.nix
7       0       dep/reflex/github.json
dan.side@avian.systems
dan.side@avian.systems
dan.side@avian.systems

what exactly does it mean to have more than one email associated with a commit? does that likely mean the person moved from one network to another (like took their laptop home, then finished their commit?) I am trying to parse the commits and assign them to a single author, but having multiple emails attached to a commit is making this harder?


Solution

  • Are you sure you are seeing a commit with multiple addresses? It looks to me that you are seeing commits with no numstat-worthy changes (e.g. merges).

    What happens if you say "%h %ae %s" instead of just "%ae"?