How to let git-log color multiline placeholder values in format string? -
given following git-log
command:
git log --max-count=1 --format='format:%c(cyan)%gg'
only first line of %gg
multiline placeholder value gets colorized. want have following text in same color until chosen color reset next %c(...)
statement. how can achieve this?
i'm using git version 2.1.0 on fedora desktop 21.
one solution came in meantime following bash script snippet:
function foobar { local -r committish="${1:-head}" local -r tput_app="$(type -p tput)" if [[ -n $tput_app ]]; local -r color_cyan="$("$tput_app" setaf 6)" local line='' while read -r line; printf '%s\n' "$color_cyan$line" done < <(git log --max-count=1 --format='format:%gg' "$committish") printf '%s\n' "$("$tput_app" sgr0)" else git log --max-count=1 --format='format:%gg' "$committish" fi }
this solution not satisfy me because prefer simple solutions simple problems. @ least works me.
Comments
Post a Comment