git log - Is it possible to dynamically generate git log format? -


i'd show author name , author date, optionally show committer name , committer date if different author name , date.

this use after rebase. author info remains same, committer info changes. if , if different, i'd show committer info in addition author info.

author , committer info same:

%c(yellow)%h%creset %s %c(cyan)(%an - %ar)%creset 

different:

%c(yellow)%h%creset %s %c(cyan)(%an - %ar, %cn - %cr)%creset 

is possible?

there no conditionals in format arguments, , no format string expands conditionally that, so: no. on other hand, extract information commit manually (in script), compare, , choose format apply 1 commit, so: yes, if you're willing outside of git log command.

for showing single commit, latter seems reasonable. looking @ whole log, suspect painful. :-) (could still done, use git rev-list generate list of revs, git log each, 1 @ time, piping whole result through same pager git log use, etc. but... painful.)


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -