[PATCH 1/10] cg-log: cleanup conversion to human readable date Simplify the date substitution and printing to give it a little speedup. Signed-off-by: Jonas Fonseca --- cg-log | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cg-log b/cg-log --- a/cg-log +++ b/cg-log @@ -188,12 +188,8 @@ $revls | $revsort | while read time comm date=(${rest#*> }) pdate="$(showdate $date)" - if [ "$pdate" ]; then - echo -n $color$key $rest | sed "s/>.*/> $pdate/" - echo $coldefault - else - echo $color$key $rest $coldefault - fi + [ "$pdate" ] && rest="${rest%> *}> $pdate" + echo $color$key $rest $coldefault ;; "tree"|"parent") if [ -z $tree1 ]; then