Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git log decorated graph with appended information

Tags:

git

Well the git log command,

git log --graph --decorate --pretty=oneline --abbrev-commit

enter image description here

shows me really niced graph. Note that the above git command applies automatic beautiful colours to "(refs/heads/, refs/tags/ and refs/remotes/)" part.

I wish I could append along with the existing format:

*<abbrevated commit> (refs/heads/, refs/tags/ and refs/remotes/) <commit message>

appending to the end

<relative date> <Vorname nachname>

finally looks like

*<abbrevated commit> (refs/heads/, refs/tags/ and refs/remotes/)* <commit message> <relative date> <Vorname nachname>

I tried the command:

git log --graph\n--pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\n--abbrev-commit --date=relative

enter image description here which gives me the same content but the the automatice colours now its is not applied on the %d parameter. Now if I wont force with yellow then, the "reset" colour is applied.

In Simple I want as below (edited image to show the Demo) enter image description here Please give your suggestions.

like image 272
Aravind Nadumane Avatar asked Mar 27 '26 10:03

Aravind Nadumane


1 Answers

Wrap %d like this:

%C(auto)%d%Creset

to get the automatic decoration coloring.

The auto coloring depends on git version >= 1.8.3: http://git.kernel.org/cgit/git/git.git/tree/Documentation/RelNotes/1.8.3.txt#n72

like image 175
jshawl Avatar answered Mar 30 '26 02:03

jshawl