1
0
Fork 0

news-fmt script now outputs author and date

website
Mike Gerwitz 2014-03-13 00:33:34 -04:00
parent ee12a7df5e
commit c440cbfbb9
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
1 changed files with 8 additions and 3 deletions

View File

@ -37,16 +37,16 @@ function escprint( str )
/^commit / { next } /^commit / { next }
# store author # store author
match( $0, /^Author: *([^<]+)/, author ) { next } match( $0, /^Author: *([^<]+)/, a ) { author = a[1]; next }
# store date # store date
match( $0, /^Date: *(.+)$/, date ) { next } match( $0, /^Date: *[^ ]+ ([^ ]+ [^ ]+ [^ ]+)/, a ) { date = a[1]; next }
# commit messages are indented by four spaces, with the subject line # commit messages are indented by four spaces, with the subject line
# occupying the first paragraph (that is---until an empty line) # occupying the first paragraph (that is---until an empty line)
/^ / { /^ / {
# begin the subject line output # begin the subject line output
printf "<h3>" printf "<h3 class=\"git-commit\">"
do { do {
escprint( $0 " " ) escprint( $0 " " )
@ -55,6 +55,11 @@ match( $0, /^Date: *(.+)$/, date ) { next }
# close subject line # close subject line
printf "</h3>" printf "</h3>"
# author
printf "<div class=\"git-commit-author\">%s</div>", author
# date
printf "<div class=\"git-commit-date\">%s</div>", date
# the rest of the commit (that is, until we find a line with # the rest of the commit (that is, until we find a line with
# non-whitespace in column one) is the body # non-whitespace in column one) is the body
printf "<pre>" printf "<pre>"