在 .gitconfig 中我有这个别名:
[alias]
...
...
...
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
所以我得到了结果:
$ g gl1 -12
* 1b9f1d0 - (20 hours ago) recreated (again) for pyton 2.7 and some new features in DB. - xiaose (xiaose-site)
* 409f299 - (5 months ago) changed internal structure. Start frontend design. - xiaose
* ff0ede9 - (5 months ago) Trying to implement new design. Everything starts from beginning. - xiaose
| * 97c9f4e - (7 months ago) Changed PNG beam to SVG and added 2 states in "Symbol" as normal & small symbols. - xiaose (xiaose-predator)
| * c97b838 - (7 months ago) Top level QML which send signal about increment value every second. - xiaose
| * d5859ee - (7 months ago) Symbol definition. There is JS file with actions for increasing & set up some number in symbol. That symbol can show numbers from 0 to 511. - xiaose
| * 1e850e7 - (7 months ago) Beam definition. In one symbol used 9 beams. 5 at the top + 4 at the bottom. - xiaose
| * 92cc1d2 - (7 months ago) There will be QML counter in Predator's style. - xiaose
|/
* fcd26c9 - (7 months ago) Initial commit. There are my own project for future impl. in productin. - xiaose (xiaose)
| * c2561c3 - (5 days ago) GT1. Fixed issue when hash checking got error & totals in order was 0. - xiaose (gt1)
| * 7dab789 - (5 days ago) GT1. Fixing issue in PP responce. - Justin Felisco
| | * d56e7fa - (5 days ago) GT1. Changes in PayPal. - Justin Felisco (grx1)
一切看起来都不错但是对于小终端窗口我得到的结果如下:
$ g gl1 -12
* 1b9f1d0 - (20 hours ago) recreated (again) for pyton 2.7 and some new feat
* 409f299 - (5 months ago) changed internal structure. Start frontend design
* ff0ede9 - (5 months ago) Trying to implement new design. Everything starts
| * 97c9f4e - (7 months ago) Changed PNG beam to SVG and added 2 states in "
| * c97b838 - (7 months ago) Top level QML which send signal about increment
| * d5859ee - (7 months ago) Symbol definition. There is JS file with action
| * 1e850e7 - (7 months ago) Beam definition. In one symbol used 9 beams. 5
| * 92cc1d2 - (7 months ago) There will be QML counter in Predator's style.
|/
* fcd26c9 - (7 months ago) Initial commit. There are my own project for futu
| * c2561c3 - (5 days ago) GT1. Fixed issue when hash checking got error & t
| * 7dab789 - (5 days ago) GT1. Fixing issue in PP responce. - Justin Felisc
| | * d56e7fa - (5 days ago) GT1. Changes in PayPal. - Justin Felisco (grx1)
所以我的问题是:是否可以做smth。字符串分开,其余的转移到新的一行?
以一种方式存在(如在评论中所述)将字符串换行为:
$ git lg1 -9 | fold -s -w 70
* 1b9f1d0 - (22 hours ago) recreated (again)
for pyton 2.7 and some new features. - xiaose
(xiaose-site)
* 409f299 - (5 months ago) changed internal
structure. Start frontend design. - xiaose
* ff0ede9 - (5 months ago) Trying to implement new design.
Everything starts from beginning - xiaose
| * 97c9f4e - (7 months ago) Changed PNG
beam to SVG and added 2 states in "Symbol" as normal & small
symbols. - xiaose (xiaose-predator)
| * c97b838 - (7 months ago) Top level QML
which send signal about increment value every second. -
xiaose
| * d5859ee - (7 months ago) Symbol
definition. There is JS file with actions for increasing & set up
some number in symbol. That symbol can show numbers from 0 to 511.
- xiaose
| * 1e850e7 - (7 months ago) Beam
definition. In one symbol used 9 beams. 5 at the top + 4 at the
bottom. - xiaose
| * 92cc1d2 - (7 months ago) There will be
QML counter in Predator's style. - xiaose
|/
* fcd26c9 - (7 months ago) Initial commit.
there will be all my projects. - xiaose
(xiaose)
但它看起来不太好......看起来很乱。
你可能知道可以做什么吗?像这样:
* 1b9f1d0 - (22 hours ago) recreated (again) for pyton 2.7 and some
| new features. - xiaose (xiaose-site)
* 409f299 - (5 months ago) changed internal structure. Start frontend
| design. - xiaose
* ff0ede9 - (5 months ago) Trying to implement new design.
| | Everything starts from beginning - xiaose
| * 97c9f4e - (7 months ago) Changed PNG
| | beam to SVG and added 2 states in "Symbol" as normal &
| | small symbols. - xiaose (xiaose-predator)
| * c97b838 - (7 months ago) Top level QML
| | which send signal about increment value every second. -
| | xiaose
| * d5859ee - (7 months ago) Symbol
| | definition. There is JS file with actions for increasing
| | & set up some number in symbol. That symbol can show
| | numbers from 0 to 511. - xiaose
| * 1e850e7 - (7 months ago) Beam definition. In one symbol used 9
| | beams. 5 at the top + 4 at the bottom. - xiaose
| * 92cc1d2 - (7 months ago) There will be QML counter in Predator's
| | style. - xiaose
|/
* fcd26c9 - (7 months ago) Initial commit. there will be all my
projects. - xiaose (xiaose)
答案 0 :(得分:1)
如果你的发行版有它,你可以尝试fold
。 E.g:
git lg1 | fold -s -w 40
将在空格处(不在单词中间)中断并调整为40个字符的宽度。但不确定它与所有变色代码的搭配程度如何。