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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -