6 git-stripspace - Remove unnecessary whitespace
12 'git stripspace' [-s | --strip-comments]
13 'git stripspace' [-c | --comment-lines]
18 Read text, such as commit messages, notes, tags and branch
19 descriptions, from the standard input and clean it in the manner
22 With no arguments, this will:
24 - remove trailing whitespace from all lines
25 - collapse multiple consecutive empty lines into one empty line
26 - remove empty lines from the beginning and end of the input
27 - add a missing '\n' to the last line if necessary.
29 In the case where the input consists entirely of whitespace characters, no
30 output will be produced.
32 *NOTE*: This is intended for cleaning metadata, prefer the `--whitespace=fix`
33 mode of linkgit:git-apply[1] for correcting whitespace of patches or files in
40 Skip and remove all lines starting with comment character (default '#').
44 Prepend comment character and blank to each line. Lines will automatically
45 be terminated with a newline. On empty lines, only the comment character
51 Given the following noisy input with '$' indicating the end of a line:
54 |A brief introduction $
58 |# with a commented-out line $
59 |explaining lots of stuff.$
61 |# An old paragraph, also commented-out. $
67 Use 'git stripspace' with no arguments to obtain:
70 |A brief introduction$
73 |# with a commented-out line$
74 |explaining lots of stuff.$
76 |# An old paragraph, also commented-out.$
81 Use 'git stripspace --strip-comments' to obtain:
84 |A brief introduction$
87 |explaining lots of stuff.$
94 Part of the linkgit:git[1] suite