Skip to content

Instantly share code, notes, and snippets.

@danielpietzsch
Created May 18, 2010 23:26
Show Gist options
  • Save danielpietzsch/405717 to your computer and use it in GitHub Desktop.
Save danielpietzsch/405717 to your computer and use it in GitHub Desktop.
A view partial you can include to display the first 8 chars of the deployed git commit. Capistrano creates the REVISION file. Maybe you need to adjust the relative path here, depending on where you store this partial.
<% number = File.read(File.dirname(__FILE__) + "/../../../REVISION").strip[0..7] if File.exists?(File.dirname(__FILE__) + "/../../../REVISION") %>
Commit: <%= number || "CURRENT" %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment