archive mirror
 help / color / mirror / Atom feed
From: Matt Rogers <>
To: Git Mailing List <>
Subject: Diff --stat for files that differ only in whitespace
Date: Fri, 31 Jul 2020 09:10:44 -0400	[thread overview]
Message-ID: <> (raw)

When using a repository with "core.autocrlf=false" I'm trying to run a diff
between two commits that have many files (~1000) changed that differ mostly
in line endings or other whitespace.  When I run
`git diff --stat --ignore-all-space <commit-1> <commit-2>` I'm getting an output
that has many files listed like:

some-file.txt | 0

This is easy enough to parse through when it's a small number of files but when
there is ~1000 files with only maybe 1500 insertions/deletions showing it's not
really useful to me to see a list of those 1000 files, if there was a way to
sort by number of insertion/deletions or filter out the files that had 0
effective changes that would solve my problem.

Simple example:

mkdir example && cd example
git init
git config --local core.autocrlf false
echo HELLO > file.txt
echo WORLD >> file.txt
git add file.txt
git commit -m "first kind of line endings"

<use an editor to swap out the line endings>
git add file.txt
git commit -m "second kind of line endings"

git diff --stat --ignore-all-space HEAD~1 HEAD

Matthew Rogers

             reply	other threads:[~2020-07-31 13:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31 13:10 Matt Rogers [this message]
2020-07-31 17:32 ` Junio C Hamano
2020-07-31 17:41 ` Jeff King
2020-07-31 19:26   ` Matt Rogers
2020-07-31 19:48     ` Jeff King
2020-07-31 20:25     ` Junio C Hamano
2020-07-31 20:43       ` Matt Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \
    --subject='Re: Diff --stat for files that differ only in whitespace' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox