Gittab-in-indent
は1.7.2(2010年7月21日)で空白のカテゴリを学習しました。Documentation / RelNotes / 1.7.2.txt
から:
- 「gitapply--whitespace」と「gitdiff」で使用される空白のルールは、スペースのみでインデントするポリシーを持つプロジェクトを支援するために、ファミリーの新しいメンバー(tab-in-indent)を取得しました。
これは、他の空白チェックオプションと同じ方法で制御および使用されます。
の強調表示git diff
は、他の空白エラーと同じです。
で確認できますgit diff --check
。
など。
tab-in-indent
構成変数の値に追加して、core.whitespace
それを有効にします(おそらく、1つ以上の特定のリポジトリー、または「グローバル」(使用ごと)構成のいずれかで)。
set-show-tabs() {
global=
test "$1" = -g || test "$1" = --global && global=--global
cws=$(git config $global core.whitespace)
case "$cws" in
tab-in-indent,*|*,tab-in-indent|*,tab-in-indent,*) ;;
*) git config $global core.whitespace "$cws"${cws:+,}tab-in-indent ;;
esac
}
set-show-tabs # only in local repository
set-show-tabs --global # for all your Git activities
# or just edit it manually with "git config [--global] --edit"
または、個々のコマンドに設定することもできます(git -c
1.7.2からも使用できます)。
git -c core.whitespace=tab-in-indent diff --check
このようなものをpre-commit
フックで使用して、実際のリポジトリ構成ファイルにタブを含めずにタブをチェックできます。