2005-08-23 08:49:47 +00:00
|
|
|
git-stripspace(1)
|
|
|
|
=================
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2011-12-12 23:52:51 +00:00
|
|
|
git-stripspace - Remove unnecessary whitespace
|
2005-08-23 08:49:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2011-07-02 02:38:26 +00:00
|
|
|
[verse]
|
2011-12-12 23:52:51 +00:00
|
|
|
'git stripspace' [-s | --strip-comments] < input
|
2005-08-23 08:49:47 +00:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2011-12-12 23:52:51 +00:00
|
|
|
|
|
|
|
Clean the input in the manner used by 'git' for text such as commit
|
|
|
|
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 08:49:47 +00:00
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
2008-06-08 01:36:09 +00:00
|
|
|
-s::
|
|
|
|
--strip-comments::
|
2011-12-12 23:52:51 +00:00
|
|
|
Skip and remove all lines starting with '#'.
|
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
--------
|
|
|
|
|
|
|
|
Given the following noisy input with '$' indicating the end of a line:
|
2007-07-23 11:58:27 +00:00
|
|
|
|
2011-12-12 23:52:51 +00: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 08:49:47 +00:00
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
2008-06-06 07:07:32 +00:00
|
|
|
Part of the linkgit:git[1] suite
|