6 git-stripspace - Remove unnecessary whitespace
12 'git stripspace' [-s | --strip-comments] < input
13 'git stripspace' [-c | --comment-lines] < input
18 Clean the input in the manner used by Git for text such as commit
19 messages, notes, tags and branch descriptions.
21 With no arguments, this will:
23 - remove trailing whitespace from all lines
24 - collapse multiple consecutive empty lines into one empty line
25 - remove empty lines from the beginning and end of the input
26 - add a missing '\n' to the last line if necessary.
28 In the case where the input consists entirely of whitespace characters, no
29 output will be produced.
31 *NOTE*: This is intended for cleaning metadata, prefer the `--whitespace=fix`
32 mode of linkgit:git-apply[1] for correcting whitespace of patches or files in
39 Skip and remove all lines starting with comment character (default '#').
43 Prepend comment character and blank to each line. Lines will automatically
44 be terminated with a newline. On empty lines, only the comment character
50 Given the following noisy input with '$' indicating the end of a line:
53 |A brief introduction $
57 |# with a commented-out line $
58 |explaining lots of stuff.$
60 |# An old paragraph, also commented-out. $
66 Use 'git stripspace' with no arguments to obtain:
69 |A brief introduction$
72 |# with a commented-out line$
73 |explaining lots of stuff.$
75 |# An old paragraph, also commented-out.$
80 Use 'git stripspace --strip-comments' to obtain:
83 |A brief introduction$
86 |explaining lots of stuff.$
93 Part of the linkgit:git[1] suite