Git fork
1git-stripspace(1)
2=================
3
4NAME
5----
6git-stripspace - Remove unnecessary whitespace
7
8
9SYNOPSIS
10--------
11[verse]
12'git stripspace' [-s | --strip-comments]
13'git stripspace' [-c | --comment-lines]
14
15DESCRIPTION
16-----------
17
18Read text, such as commit messages, notes, tags and branch
19descriptions, from the standard input and clean it in the manner
20used by Git.
21
22With no arguments, this will:
23
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.
28
29In the case where the input consists entirely of whitespace characters, no
30output will be produced.
31
32*NOTE*: This is intended for cleaning metadata. Prefer the `--whitespace=fix`
33mode of linkgit:git-apply[1] for correcting whitespace of patches or files in
34the repository.
35
36OPTIONS
37-------
38-s::
39--strip-comments::
40 Skip and remove all lines starting with a comment character
41 (`core.commentChar`, default `#`).
42
43-c::
44--comment-lines::
45 Prepend the comment character and a blank space to each line. Lines will automatically
46 be terminated with a newline. On empty lines, only the comment character
47 will be prepended.
48
49EXAMPLES
50--------
51
52Given the following noisy input with '$' indicating the end of a line:
53
54---------
55|A brief introduction $
56| $
57|$
58|A new paragraph$
59|# with a commented-out line $
60|explaining lots of stuff.$
61|$
62|# An old paragraph, also commented-out. $
63| $
64|The end.$
65| $
66---------
67
68Use 'git stripspace' with no arguments to obtain:
69
70---------
71|A brief introduction$
72|$
73|A new paragraph$
74|# with a commented-out line$
75|explaining lots of stuff.$
76|$
77|# An old paragraph, also commented-out.$
78|$
79|The end.$
80---------
81
82Use 'git stripspace --strip-comments' to obtain:
83
84---------
85|A brief introduction$
86|$
87|A new paragraph$
88|explaining lots of stuff.$
89|$
90|The end.$
91---------
92
93GIT
94---
95Part of the linkgit:git[1] suite