Skip to content

Instantly share code, notes, and snippets.


John Dillick jdillick

View GitHub Profile
jdillick /
Created Jan 17, 2013
Found this little gem of python for comparing a git repo to an un-versioned copy of the code. I returns the closest commit hash from the git repository corresponding to your code. This works great when you don't know what version of the code you have running.
#!/usr/bin/env python
import subprocess
import shlex
import sys
import os
import operator
proc=subprocess.Popen(shlex.split('git rev-list --all'),stdout=subprocess.PIPE)
You can’t perform that action at this time.