如何以自定义漂亮的日志格式在每个新行上附加选项卡?

rei*_*eid 2 git bash terminal

我一直在尝试使用 Git 日志进行哪些自定义,我想我已经确定了适合我的日志。但是,我不确定如何标记整个 git 消息。我可以在第一行完成,并且我假设整个 git 消息是一个长字符串。

另外,是否可以像 Git log default 那样输出整个 git commit 消息?也就是说,消息的每行 1 行。

默认的 Git 日志:

commit 3246e9dfcf80d8edada9a559684b528658b8ccf5
Author: Reid
Date:   Thu Jun 9 16:30:35 2016 -0400

    Refactored Loading Indicators

commit 219a67a34036b40d18091ea3a1df6417c5feb245
Author: Reid
Date:   Fri Jun 3 14:50:59 2016 -0400

    Filter out Promotions < 0
    Submission of Promo Code working with error messages
    Refactored Loading Indicators
    Limit 1 promo code per order via Mini Cart
    Cart stays open if they change quantity of item
    Migrated Drawer Animation to an Extension
    Hooked into hideAllNavigation()
    Dynamically Set Items Container Height
    Implement the Mini Cart Experience Flag
Run Code Online (Sandbox Code Playgroud)

我的自定义 git 日志格式:

3246e9d 2016-06-09 [Reid]

        Refactored Loading Indicators

219a67a 2016-06-03 [Reid]

        Filter out Promotions < 0 Submission of Promo Code working with error messages Refactored Loading Indicators Limit 1 promo code per order via Mini Cart Cart stays open if they change quantity of item Migrated Drawer Animation to an Extension Hooked into hideAllNavigation() Dynamically Set Items Container Height Implement the Mini Cart Experience Flag
Run Code Online (Sandbox Code Playgroud)

我在 git config 中的自定义 git log 别名:

[alias]
    logg = log --pretty=format:'%C(197)%h%Creset %C(039)%ad%Creset %C(177)[%an <%ae>]%Creset%n%n\t%s%n' --date=short
Run Code Online (Sandbox Code Playgroud)

mid*_*kid 9

根据git-log联机帮助页,格式字符之一是:

%x00: 从十六进制代码打印一个字节

正如x09\t 的十六进制代码一样,您可以插入%x09,它将代表一个制表符。