Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: How to fix (and find) many git-* --check errors?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:07

"Peter Valdemar Mørch (Lists)"  [off-list ref] writes:
We have > 37000 white space "errors" in HEAD, mostly trailing
whitespace, and I'm looking for a

$ git diff --check | git??? --whitespace=fix

command.
Starting from a clean checkout, you could do something like this:

	$ git reset --hard
        $ rm .git/index
        $ git diff --binary -R HEAD >P.diff
        $ git apply --whitespace=fix --cached <P.diff
	$ git commit -m "Fixed all whitespace gotchas"

P.diff contains essentially everything, and you are recreating everything
from that patch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help