[PATCH 3/10] Separate handling of author and committer in commit headers
- From
Jonas Fonseca <fonseca@diku.dk>
- Date
- Jun 4, 2005, 14:40 UTC
- Message-ID
- <20050604144002.GG12615@diku.dk>
- In-Reply-To
- <20050604143831.GD12615@diku.dk>
Parse and print the author and committer header entries so the color logic can be removed.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> ---
cg-log | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/cg-log b/cg-log --- a/cg-log +++ b/cg-log @@ -162,6 +162,8 @@ fi $revls | $revsort | while read time commit parents; do trap exit SIGPIPE + author= + committer= tree= parents=() [ "$revfmt" = "git-rev-list" ] && commit="$time" @@ -179,17 +181,19 @@ $revls | $revsort | while read time comm while read key rest; do trap exit SIGPIPE case "$key" in - "author"|"committer") - if [ "$key" = "author" ]; then - color="$colauthor" - else - color="$colcommitter" - fi - - date=(${rest#*> }) + "author") + author="$rest" + date=(${author#*> }) + pdate="$(showdate $date)" + [ "$pdate" ] && author="${author%> *}> $pdate" + echo $colauthor$key $author $coldefault + ;; + "committer") + committer="$rest" + date=(${committer#*> }) pdate="$(showdate $date)" - [ "$pdate" ] && rest="${rest%> *}> $pdate" - echo $color$key $rest $coldefault + [ "$pdate" ] && committer="${committer%> *}> $pdate" + echo $colcommitter$key $committer $coldefault ;; "tree") tree="$rest"
-- Jonas Fonseca