CorruptSaveState

The ramblings of a madman.

GitTrip - Nerd Acid

Avatar
Posted by Oshuma, on July 05, 2008 - 0 comments
Tags: gittrip, ruby

There are many different types of git repository browsers, but none (that I’m aware of) allow you to ‘really’ visually browse a repository. Let me explain.

Everyone knows that each git object is a 40 character SHA string, containing only 0-9a-f. With that said, you can create a single RGB color using a 6 character string consisting of 0-9a-f. So, from each git object, you can grab (for example) 6 RGB colors (using the ”#RRGGBB” format), with 4 characters of the SHA left over. These colors are used to create a truly visual representation of the git object.

Here’s an image that was generated from the GitTrip repository (using the above example to determine the number of colors):

Here’s the SHA broken down:

0996d1ec3c0da1ff5ac91e5ed5678139932e ad4d
0996d1ec3c0da1ff5ac91e5ed5678139932e name

By default, the image ‘name’ (NOT filename) contains the remaining 4 characters interpolated with some other random data pulled from the SHA.

The only thing that’s set in stone is the image generation based on the SHA. Everything in the middle will be configurable or scriptable.

For more information:

Add Comment