I am looking for a way to show only the conflicting part of merge commits in a git log, preferably along with all the other (non-merge) diffs from a history I get with
git log --numstat
. There is a question similar to mine that was already answered: Show conflict diff part of a merge. I can amend one answer to
git diff hash hash^1 hash^2 --numstat
but this does only allow me to show the diff for one commit at the time and not embedded in the history. Ultimately, I want to reconstruct the number of lines in each file from a log (cumulative sum of insertions - deletions), which works just fine for now as long as there were no merge conflicts.
If I use the full diff for merges (e.g. with git log --numstat -m
), I don't get the diff to the immediate parent, but a diff including some changes that are reported in earlier non-merge commits already, which messes up my counting of insertions/deletions.
I know I may ask too much from git log
with such a specific use case. I can work around with with the answer linked above, but it's just much more work.
Any help appreciated.