Merge branch 'jk/enable-test-lint-by-default' into maint
[git/jnareb-git.git] / Documentation / git-stripspace.txt
bloba80d94650d3a6b724dc68aac18fd562ff38d2cf8
1 git-stripspace(1)
2 =================
4 NAME
5 ----
6 git-stripspace - Remove unnecessary whitespace
9 SYNOPSIS
10 --------
11 [verse]
12 'git stripspace' [-s | --strip-comments] < input
14 DESCRIPTION
15 -----------
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
32 the repository.
34 OPTIONS
35 -------
36 -s::
37 --strip-comments::
38         Skip and remove all lines starting with '#'.
40 EXAMPLES
41 --------
43 Given the following noisy input with '$' indicating the end of a line:
45 --------
46 |A brief introduction   $
47 |   $
49 |A new paragraph$
50 |# with a commented-out line    $
51 |explaining lots of stuff.$
53 |# An old paragraph, also commented-out. $
54 |      $
55 |The end.$
56 |  $
57 ---------
59 Use 'git stripspace' with no arguments to obtain:
61 --------
62 |A brief introduction$
64 |A new paragraph$
65 |# with a commented-out line$
66 |explaining lots of stuff.$
68 |# An old paragraph, also commented-out.$
70 |The end.$
71 ---------
73 Use 'git stripspace --strip-comments' to obtain:
75 --------
76 |A brief introduction$
78 |A new paragraph$
79 |explaining lots of stuff.$
81 |The end.$
82 ---------
84 GIT
85 ---
86 Part of the linkgit:git[1] suite