6 git-stripspace - Remove unnecessary whitespace
12 'git stripspace' [-s | --strip-comments] < input
17 Clean the input in the manner used by Git for text such as commit
18 messages, notes, tags and branch descriptions.
20 With no arguments, this will:
22 - remove trailing whitespace from all lines
23 - collapse multiple consecutive empty lines into one empty line
24 - remove empty lines from the beginning and end of the input
25 - add a missing '\n' to the last line if necessary.
27 In the case where the input consists entirely of whitespace characters, no
28 output will be produced.
30 *NOTE*: This is intended for cleaning metadata, prefer the `--whitespace=fix`
31 mode of linkgit:git-apply[1] for correcting whitespace of patches or files in
38 Skip and remove all lines starting with comment character (default '#').
42 Prepend comment character and blank to each line. Lines will automatically
43 be terminated with a newline. On empty lines, only the comment character
49 Given the following noisy input with '$' indicating the end of a line:
52 |A brief introduction $
56 |# with a commented-out line $
57 |explaining lots of stuff.$
59 |# An old paragraph, also commented-out. $
65 Use 'git stripspace' with no arguments to obtain:
68 |A brief introduction$
71 |# with a commented-out line$
72 |explaining lots of stuff.$
74 |# An old paragraph, also commented-out.$
79 Use 'git stripspace --strip-comments' to obtain:
82 |A brief introduction$
85 |explaining lots of stuff.$
92 Part of the linkgit:git[1] suite