Kevin Marsh

Your Rails Apps Changelog in git

OK, this one is almost too hacky and simple to share, but I wanted to get it out there. Want to show your site’s users what’s changed? Just show them your git changelog:

It’s a bit dorky, and definately not as pretty as a properly parsed and formatted changelog, but for showing stakeholders what’s changed it’s been useful.

Here’s how it’s done (again, kind of a hack):

Controller

@code = `cd /var/www/vintageaerial.com/htdocs/shared/cached-copy && git-log --max-count=20 --no-merges`

View

<pre class="changelog"><%= @changes %></pre>

Stylesheet

pre.changelog { overflow: scroll; }

I definitely wouldn’t use this in high-traffic production areas without some caching. It’s also enforcing me to write better, more communicative changeset descriptions, because I know someone can read them.