2016-12-10 12 views
0

私はgitのgitログにコミッターの手紙を印刷するには?

# excerpt from ~/.gitconfig 
[alias] 
    lg = log --all --oneline --graph --decorate --pretty='%C(auto)%h %Cgreen%ai %C(reset)%C(auto)%s %d' 

git lgに短いログレポートを取得するためのエイリアスを作成しているがなく、ユーザの情報なしに、コミットごとに素敵なラインを生成します。

* 623beff 2016-11-14 14:18:36 +0100 extended plotstyle option and automatic colors 

やスクリーンショットなど:

example screenshot

しかし、したい各行に(フルネームは時々長すぎる)コミッター本名の頭文字を参照してください。

* 623beff 2016-11-14 14:18:36 +0100 (J.S.) extended plotstyle option and automatic colors 

は、どのように私はこの結果を得ることができますか?

答えて

1

%<(3,trunc)%cNを使用して、最初の名前の最初の文字を取得するためにこれを行う方法があります:

git log --all --oneline --graph --decorate --pretty='%C(auto)%h %Cgreen%ai %C(reset)%C(auto)(%<(3,trunc)%cN) %s %d' 

出力:

* 8759307 2009-01-15 16:11:48 +0000 (S..) Remove spurious code trying to tag a branch root before the mark was created. (HEAD -> master, origin/master, origin/HEAD) 
* 939f999 2008-12-11 13:41:37 +0000 (S..) When just writing output file, do not try to devise lock target with no repository. 
関連する問題