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

Re: [PATCH 0/3] Fix assorted white space damage

From
Junio C Hamano <junkio@cox.net>
Date
May 13, 2007, 01:45 UTC
Message-ID
<7vzm49ts2f.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<e5bfff550705120409v629425aesc910927c26871323@mail.gmail.com>
"Marco Costalba" <mcostalba@gmail.com> writes:
Show 12 quoted lines
> Following there is a 3  patch series to remove stealth whitespace.
>
> I have used the new 'cleanfile' script by H. Peter Anvin, just merged
> in Linux tree.
>
> The script cleans up various classes of stealth whitespace.  In
> particular, it cleans up:
>
>  - Whitespace (spaces or tabs)before newline;
>  - DOS line endings (CR before LF);
>  - Space before tab (spaces are deleted or converted to tabs);
>  - Empty lines at end of file.

I haven't checked the script, but "git-apply --whitespace=strip" can be used to do pretty much the same job with this sequence, except the last one (do it with a copy of repository if you do not want "git clean -x" to lose untracked):

	$ git checkout master
        $ rm -f .git/index
        $ git checkout HEAD -- t/
        $ git clean -x -d
	$ git diff -R --binary HEAD >P.diff
        $ git apply --index --whitespace=strip P.diff
Then you can check the results, and make a commit.

In the above I explicitly "saved" t/ because we have some test vectors that need to have trailing whitespaces.

Previous: Marco CostalbaNext: Johannes Schindelin
Message 4 of 6 in “Fix assorted white space damage”
  1. 0/3 Fix assorted white space damageMarco Costalba, May 12, 2007
  2. Junio C HamanoMay 12, 2007
  3. Marco CostalbaMay 13, 2007
  4. Junio C HamanoMay 13, 2007
  5. Johannes SchindelinMay 13, 2007
  6. Junio C HamanoMay 13, 2007

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.