logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

git-stripspace.1 (3688B)


  1. '\" t
  2. .\" Title: git-stripspace
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-STRIPSPACE" "1" "2025-03-14" "Git 2\&.49\&.0" "Git Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-stripspace \- Remove unnecessary whitespace
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit stripspace\fR [\-s | \-\-strip\-comments]
  36. \fIgit stripspace\fR [\-c | \-\-comment\-lines]
  37. .fi
  38. .SH "DESCRIPTION"
  39. .sp
  40. Read text, such as commit messages, notes, tags and branch descriptions, from the standard input and clean it in the manner used by Git\&.
  41. .sp
  42. With no arguments, this will:
  43. .sp
  44. .RS 4
  45. .ie n \{\
  46. \h'-04'\(bu\h'+03'\c
  47. .\}
  48. .el \{\
  49. .sp -1
  50. .IP \(bu 2.3
  51. .\}
  52. remove trailing whitespace from all lines
  53. .RE
  54. .sp
  55. .RS 4
  56. .ie n \{\
  57. \h'-04'\(bu\h'+03'\c
  58. .\}
  59. .el \{\
  60. .sp -1
  61. .IP \(bu 2.3
  62. .\}
  63. collapse multiple consecutive empty lines into one empty line
  64. .RE
  65. .sp
  66. .RS 4
  67. .ie n \{\
  68. \h'-04'\(bu\h'+03'\c
  69. .\}
  70. .el \{\
  71. .sp -1
  72. .IP \(bu 2.3
  73. .\}
  74. remove empty lines from the beginning and end of the input
  75. .RE
  76. .sp
  77. .RS 4
  78. .ie n \{\
  79. \h'-04'\(bu\h'+03'\c
  80. .\}
  81. .el \{\
  82. .sp -1
  83. .IP \(bu 2.3
  84. .\}
  85. add a missing
  86. \fI\en\fR
  87. to the last line if necessary\&.
  88. .RE
  89. .sp
  90. In the case where the input consists entirely of whitespace characters, no output will be produced\&.
  91. .sp
  92. \fBNOTE\fR: This is intended for cleaning metadata\&. Prefer the \fB\-\-whitespace=fix\fR mode of \fBgit-apply\fR(1) for correcting whitespace of patches or files in the repository\&.
  93. .SH "OPTIONS"
  94. .PP
  95. \-s, \-\-strip\-comments
  96. .RS 4
  97. Skip and remove all lines starting with a comment character (default
  98. \fI#\fR)\&.
  99. .RE
  100. .PP
  101. \-c, \-\-comment\-lines
  102. .RS 4
  103. Prepend the comment character and a blank space to each line\&. Lines will automatically be terminated with a newline\&. On empty lines, only the comment character will be prepended\&.
  104. .RE
  105. .SH "EXAMPLES"
  106. .sp
  107. Given the following noisy input with \fI$\fR indicating the end of a line:
  108. .sp
  109. .if n \{\
  110. .RS 4
  111. .\}
  112. .nf
  113. |A brief introduction $
  114. | $
  115. |$
  116. |A new paragraph$
  117. |# with a commented\-out line $
  118. |explaining lots of stuff\&.$
  119. |$
  120. |# An old paragraph, also commented\-out\&. $
  121. | $
  122. |The end\&.$
  123. | $
  124. .fi
  125. .if n \{\
  126. .RE
  127. .\}
  128. .sp
  129. Use \fIgit stripspace\fR with no arguments to obtain:
  130. .sp
  131. .if n \{\
  132. .RS 4
  133. .\}
  134. .nf
  135. |A brief introduction$
  136. |$
  137. |A new paragraph$
  138. |# with a commented\-out line$
  139. |explaining lots of stuff\&.$
  140. |$
  141. |# An old paragraph, also commented\-out\&.$
  142. |$
  143. |The end\&.$
  144. .fi
  145. .if n \{\
  146. .RE
  147. .\}
  148. .sp
  149. Use \fIgit stripspace \-\-strip\-comments\fR to obtain:
  150. .sp
  151. .if n \{\
  152. .RS 4
  153. .\}
  154. .nf
  155. |A brief introduction$
  156. |$
  157. |A new paragraph$
  158. |explaining lots of stuff\&.$
  159. |$
  160. |The end\&.$
  161. .fi
  162. .if n \{\
  163. .RE
  164. .\}
  165. .SH "GIT"
  166. .sp
  167. Part of the \fBgit\fR(1) suite