2005-08-23 10:49:47 +02:00
|
|
|
git-stripspace(1)
|
|
|
|
=================
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2011-12-13 00:52:51 +01:00
|
|
|
git-stripspace - Remove unnecessary whitespace
|
2005-08-23 10:49:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2011-07-02 04:38:26 +02:00
|
|
|
[verse]
|
2011-12-13 00:52:51 +01:00
|
|
|
'git stripspace' [-s | --strip-comments] < input
|
2005-08-23 10:49:47 +02:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2011-12-13 00:52:51 +01:00
|
|
|
|
2013-01-21 20:17:53 +01:00
|
|
|
Clean the input in the manner used by Git for text such as commit
|
2011-12-13 00:52:51 +01:00
|
|
|
messages, notes, tags and branch descriptions.
|
|
|
|
|
|
|
|
With no arguments, this will:
|
|
|
|
|
|
|
|
- remove trailing whitespace from all lines
|
|
|
|
- collapse multiple consecutive empty lines into one empty line
|
|
|
|
- remove empty lines from the beginning and end of the input
|
|
|
|
- add a missing '\n' to the last line if necessary.
|
|
|
|
|
|
|
|
In the case where the input consists entirely of whitespace characters, no
|
|
|
|
output will be produced.
|
|
|
|
|
|
|
|
*NOTE*: This is intended for cleaning metadata, prefer the `--whitespace=fix`
|
|
|
|
mode of linkgit:git-apply[1] for correcting whitespace of patches or files in
|
|
|
|
the repository.
|
2005-08-23 10:49:47 +02:00
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
2008-06-08 03:36:09 +02:00
|
|
|
-s::
|
|
|
|
--strip-comments::
|
2013-01-16 20:18:48 +01:00
|
|
|
Skip and remove all lines starting with comment character (default '#').
|
|
|
|
|
|
|
|
-c::
|
|
|
|
--comment-lines::
|
|
|
|
Prepend comment character and blank to each line. Lines will automatically
|
|
|
|
be terminated with a newline. On empty lines, only the comment character
|
|
|
|
will be prepended.
|
2011-12-13 00:52:51 +01:00
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
--------
|
|
|
|
|
|
|
|
Given the following noisy input with '$' indicating the end of a line:
|
2007-07-23 13:58:27 +02:00
|
|
|
|
2011-12-13 00:52:51 +01:00
|
|
|
--------
|
|
|
|
|A brief introduction $
|
|
|
|
| $
|
|
|
|
|$
|
|
|
|
|A new paragraph$
|
|
|
|
|# with a commented-out line $
|
|
|
|
|explaining lots of stuff.$
|
|
|
|
|$
|
|
|
|
|# An old paragraph, also commented-out. $
|
|
|
|
| $
|
|
|
|
|The end.$
|
|
|
|
| $
|
|
|
|
---------
|
|
|
|
|
|
|
|
Use 'git stripspace' with no arguments to obtain:
|
|
|
|
|
|
|
|
--------
|
|
|
|
|A brief introduction$
|
|
|
|
|$
|
|
|
|
|A new paragraph$
|
|
|
|
|# with a commented-out line$
|
|
|
|
|explaining lots of stuff.$
|
|
|
|
|$
|
|
|
|
|# An old paragraph, also commented-out.$
|
|
|
|
|$
|
|
|
|
|The end.$
|
|
|
|
---------
|
|
|
|
|
|
|
|
Use 'git stripspace --strip-comments' to obtain:
|
|
|
|
|
|
|
|
--------
|
|
|
|
|A brief introduction$
|
|
|
|
|$
|
|
|
|
|A new paragraph$
|
|
|
|
|explaining lots of stuff.$
|
|
|
|
|$
|
|
|
|
|The end.$
|
|
|
|
---------
|
2005-08-23 10:49:47 +02:00
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
2008-06-06 09:07:32 +02:00
|
|
|
Part of the linkgit:git[1] suite
|