man-pages/man1/git-stripspace.1.html
2021-03-31 01:06:50 +01:00

207 lines
3.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of GIT-STRIPSPACE</TITLE>
</HEAD><BODY>
<H1>GIT-STRIPSPACE</H1>
Section: Git Manual (1)<BR>Updated: 03/04/2021<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
git-stripspace - Remove unnecessary whitespace
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<PRE>
<I>git stripspace</I> [-s | --strip-comments]
<I>git stripspace</I> [-c | --comment-lines]
</PRE>
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
Read text, such as commit messages, notes, tags and branch descriptions, from the standard input and clean it in the manner used by Git.
<P>
With no arguments, this will:
<P>
<DL COMPACT><DT id="1"><DD>
&bull;
remove trailing whitespace from all lines
</DL>
<P>
<DL COMPACT><DT id="2"><DD>
&bull;
collapse multiple consecutive empty lines into one empty line
</DL>
<P>
<DL COMPACT><DT id="3"><DD>
&bull;
remove empty lines from the beginning and end of the input
</DL>
<P>
<DL COMPACT><DT id="4"><DD>
&bull;
add a missing
<I>\n</I>
to the last line if necessary.
</DL>
<P>
In the case where the input consists entirely of whitespace characters, no output will be produced.
<P>
<B>NOTE</B>: This is intended for cleaning metadata, prefer the <B>--whitespace=fix</B> mode of <B><A HREF="/cgi-bin/man/man2html?1+git-apply">git-apply</A></B>(1) for correcting whitespace of patches or files in the repository.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<P>
-s, --strip-comments
<DL COMPACT><DT id="5"><DD>
Skip and remove all lines starting with comment character (default
<I>#</I>).
</DL>
<P>
-c, --comment-lines
<DL COMPACT><DT id="6"><DD>
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.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>EXAMPLES</H2>
<P>
Given the following noisy input with <I>$</I> indicating the end of a line:
<P>
<DL COMPACT><DT id="7"><DD>
<PRE>
|A brief introduction $
| $
|$
|A new paragraph$
|# with a commented-out line $
|explaining lots of stuff.$
|$
|# An old paragraph, also commented-out. $
| $
|The end.$
| $
</PRE>
</DL>
<P>
<P>
Use <I>git stripspace</I> with no arguments to obtain:
<P>
<DL COMPACT><DT id="8"><DD>
<PRE>
|A brief introduction$
|$
|A new paragraph$
|# with a commented-out line$
|explaining lots of stuff.$
|$
|# An old paragraph, also commented-out.$
|$
|The end.$
</PRE>
</DL>
<P>
<P>
Use <I>git stripspace --strip-comments</I> to obtain:
<P>
<DL COMPACT><DT id="9"><DD>
<PRE>
|A brief introduction$
|$
|A new paragraph$
|explaining lots of stuff.$
|$
|The end.$
</PRE>
</DL>
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>GIT</H2>
<P>
Part of the <B><A HREF="/cgi-bin/man/man2html?1+git">git</A></B>(1) suite
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="10"><A HREF="#lbAB">NAME</A><DD>
<DT id="11"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="12"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="13"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="14"><A HREF="#lbAF">EXAMPLES</A><DD>
<DT id="15"><A HREF="#lbAG">GIT</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:15 GMT, March 31, 2021
</BODY>
</HTML>