Git
English ▾ トピック ▾ 最新バージョン ▾ git-stripspace の最終更新は 2.43.0 です

NAME

git-stripspace - 不要な空白を削除する

SYNOPSIS

git stripspace [-s | --strip-comments]
git stripspace [-c | --comment-lines]

DESCRIPTION

コミットメッセージ、ノート、タグ、ブランチの説明などのテキストを標準入力から読み込み、Gitで使用される方法でクリーンにします。

引数なしの場合、これは

  • すべての行から末尾の空白を削除します

  • 複数の連続した空行を1つの空行に折りたたみます

  • 入力の先頭と末尾から空行を削除します

  • 必要に応じて、最後の行に不足している\nを追加します。

入力が完全に空白文字で構成されている場合、出力は生成されません。

注意: これはメタデータのクリーニングを目的としています。リポジトリ内のパッチやファイルの空白を修正するには、git-apply[1]--whitespace=fix モードを使用してください。

OPTIONS

-s
--strip-comments

コメント文字(デフォルト#)で始まるすべての行をスキップして削除します。

-c
--comment-lines

各行にコメント文字と空白を先頭に追加します。行は自動的に改行で終了します。空行の場合、コメント文字のみが先頭に追加されます。

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

git[1]スイートの一部

scroll-to-top