You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Commits tab I can see all commits in current branch and there are initials of person who made that commit. I wanted to implement similiar feature to allBranchesLogCmd which looked like this git log --pretty=format:"%C(yellow)%h %C(auto)%aN %C(cyan)%ar %C(auto)%d %C(reset) %s" --graph --all --color=always --date-order.
After some reserch I found out, that git log can't shorten the author name to only name initials. My idea was that if git log doesn't support it, I can pipe it to sed. My sed command looks like this sed -E "s/^(((\x1b\[[0-9;]*m)|[ *|\\/_.])+ \x1b\[[0-9;]*m[a-z0-9]{7} \x1b\[[0-9;]*m)(([A-ZŠČŘŽÚ])(\S+))(( ([A-ZŠČŘŽ])(\S+))+)/\1\5\9/g"
and it produces this (colored):
* 1d79558 DV 5 hours ago (HEAD -> xxx) xxx
|\
* \ 9ca5ecd PČ 28 hours ago (xxx) xxx
|\ \
| * | 495eca8 PČ 28 hours ago Fix off mode
| | * 2182e72 LS 2 days ago (xxx) SDRAM CLK 80 MHz -> 135 MHz
| |/
|/|
| * f6c0210 PČ 3 days ago Added events and off mode supoort
|/
* fbd56ad DV 5 days ago infotab refactoring (use of cached scrollable)
After applying changes to allBranchesLogCmd: 'git log --pretty=format:"%C(yellow)%h %C(auto)%aN %C(cyan)%ar %C(auto)%d %C(reset) %s" --graph --all --color=always --date-order | sed -E "s/^(((\x1b\[[0-9;]*m)|[ *|\\/_.])+ \x1b\[[0-9;]*m[a-z0-9]{7} \x1b\[[0-9;]*m)(([A-ZŠČŘŽÚ])(\S+))(( ([A-ZŠČŘŽ])(\S+))+)/\1\5\9/g"' I am getting following: "fatal: ambiguous argument '|': unknown revision or path not in working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]'".
Also I would like to know if there is a way to have each person having unique color of his initials as it is in Commits tab.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In Commits tab I can see all commits in current branch and there are initials of person who made that commit. I wanted to implement similiar feature to
allBranchesLogCmd
which looked like thisgit log --pretty=format:"%C(yellow)%h %C(auto)%aN %C(cyan)%ar %C(auto)%d %C(reset) %s" --graph --all --color=always --date-order
.After some reserch I found out, that git log can't shorten the author name to only name initials. My idea was that if git log doesn't support it, I can pipe it to sed. My sed command looks like this
sed -E "s/^(((\x1b\[[0-9;]*m)|[ *|\\/_.])+ \x1b\[[0-9;]*m[a-z0-9]{7} \x1b\[[0-9;]*m)(([A-ZŠČŘŽÚ])(\S+))(( ([A-ZŠČŘŽ])(\S+))+)/\1\5\9/g"
and it produces this (colored):
After applying changes to
allBranchesLogCmd: 'git log --pretty=format:"%C(yellow)%h %C(auto)%aN %C(cyan)%ar %C(auto)%d %C(reset) %s" --graph --all --color=always --date-order | sed -E "s/^(((\x1b\[[0-9;]*m)|[ *|\\/_.])+ \x1b\[[0-9;]*m[a-z0-9]{7} \x1b\[[0-9;]*m)(([A-ZŠČŘŽÚ])(\S+))(( ([A-ZŠČŘŽ])(\S+))+)/\1\5\9/g"'
I am getting following: "fatal: ambiguous argument '|': unknown revision or path not in working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]'".Also I would like to know if there is a way to have each person having unique color of his initials as it is in Commits tab.
Beta Was this translation helpful? Give feedback.
All reactions