Skip to content

Instantly share code, notes, and snippets.

@timcunningham
Created August 17, 2012 16:51
Show Gist options
  • Save timcunningham/3380505 to your computer and use it in GitHub Desktop.
Save timcunningham/3380505 to your computer and use it in GitHub Desktop.
Add this to the .gitConfig file in your repository
#Add this to your .gitConfig file in your .git folder
#To to execute type at git bash: git log-json > ChangeLog.json
#It will save the output to a file named ChangeLog.json
#You can use this file to create your own pretty version of the ChangeLog
[alias]
log-json = !git log --pretty=format:'\"%h\": {%n \"commit\": \"%H\",%n \"author\": \"%an <%ae>\",%n \"date\": \"%ai\",%n \"message\": \"%s\"%n},'
<cffile action="read" file="#expandPath("./")#changeLog.json" variable="changeLog">
<cfset changeLog = "{" & changeLog>
<cfset changeLog = left(changeLog,len(changelog)-1)>
<cfset changeLog = changeLog & "}">
<cfset changeLog = deserializeJSON(changeLog)>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ChangeLog</title>
<meta name="description" content="Change from Git Log">
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.0.4/css/bootstrap-combined.min.css" rel="stylesheet">
</head>
<body>
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Message</th>
<th>Author</th>
<th>Commit</th>
</tr>
</thead>
<tbody>
<cfloop collection="#changeLog#" item="x"><cfoutput>
<tr>
<td>#variables.changeLog[x].date# </td>
<td>#left(variables.changeLog[x].message,100)# </td>
<td>#variables.changeLog[x].author#</td>
<td>#x#</td>
</tr>
</cfoutput></cfloop>
</tbody>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment