SYNOPSIS
gitstripspace
[-s
|--strip-comments
] gitstripspace
[-c
|--comment-lines
]
DESCRIPTION
コミットメッセージ・メモ・タグ・ブランチの説明などのテキストを標準の入力から読み取り、Gitで使用されている作法でクリーンアップします。
引数なしの場合、この作法は以下のようになります:
-
全ての行の末尾の空白(whitespace)を取り除く
-
複数の連続する空行を1つの空行に折りたたむ
-
入力の最初と最後から空行を削除
-
必要に応じて、欠落している \n を最後の行に追加します。
入力がすべて空白文字(whitespace characters)で構成されている場合、出力は生成されません。
注意 これはメタデータのクリーンアップを目的としています。
パッチやリポジトリ内のファイルの空白を修正する場合は、
git-apply(1) の --whitespace=fix
モードを優先してください。
OPTIONS
-
-s
-
--strip-comments
-
コメント文字(デフォルトは # )で始まるすべての行をスキップして削除します。
-
-c
-
--comment-lines
-
各行の先頭にコメント文字と空白1つを追加します。 行は自動的に改行で終了します。 空行ではコメント文字のみが追加されます。
EXAMPLES
以下のようなノイズの多い入力があるとします。 $
は行の終わりを示しています:
|A brief introduction $
| $
|$
|A new paragraph$
|# with a commented-out line $
|explaining lots of stuff.$
|$
|# An old paragraph, also commented-out. $
| $
|The end.$
| $
git
stripspace
を引数無しで実行すると以下のようになります:
|A brief introduction$
|$
|A new paragraph$
|# with a commented-out line$
|explaining lots of stuff.$
|$
|# An old paragraph, also commented-out.$
|$
|The end.$
git
stripspace
--strip-comments
を使うと以下のようになります:
|A brief introduction$
|$
|A new paragraph$
|explaining lots of stuff.$
|$
|The end.$
GIT
Part of the git(1) suite