I'd like to be able to associate an image with some of my commits, so that I can browse through them at a latter date. I code a lot of visualisations and often find myself wanting to go back to a certain itteration of a graphic that I had done a few days before, in a given project, but struggle to find which actual commit it was by just reading through the comments. If I was able to save a screen grab with my commits, then it would be much easier to pick out the commit I'm interested in.

In Mike Bostock's talk at the Open Vis Conference this year, he talks about an internal tool they created at the New York Times, called Preview, which achieves this functionality; I'm hoping that someone on SO will be able to point me a similar tool which is available to the public.

I've also come across an amusing tool called lolcommits which uses your webcam to take a selfie on each commit (their website says that git blame has never been so much fun!); so close to what I want, just the wrong image!


Taking and saving the screenshots are easy enough just use the pre-commit/post hooks to generate a screen shot of the image(s) that you are interested in.

The problem is that the git browser doesn't let you view them if they are committed so why not use a simple python script to generate low definition views of the, (potentially only the changed), graphics in your source tree and save them to a directory based on the commit ID possibly generating a web page for that commits - possibly with an automatically generated text for update to that commit.

If your graphics are produced as a result of running the code your pre-commit script could even include a build into a test program which outputs the images.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.