Github display/en

De Wiki LOGre
Aller à : navigation, rechercher
Language: Français  • English


After a discussion with Amaury who noticed that contribution display in Github looks like a pixel array I decided to try to use it in this way
I decided to create a soft generating a GIt contribution history in order to display patterns or text like in following picture

Hello World display

Involved Technos

  • C++ language with a focus on Date and Time API introduced with C++11 standard
  • Compiler g++
  • Version manager Git
  • Shell scripts
  • SSH




Git has a lot of advanced features, the one that is interesting here is the capability to fix commit date
From current date software compute for each Activity display pixel how many days has elapsed until now
From a BMP file containing the pattern to display the sofware will generate commits for each pixel to light on and finish by pushing them in a GIthub repo
TO interact with Git repo software generates a shell script and execute it using execvp


  • Read a BMP file as input to define pattern to display
  • Ability to use a Github account different from your default account
  • Automatic generation of ssh config file to use SSH Key dedicated to Github account which displays pattern
  • Creation of a local Git repo with an initial commit far in the past so that it doesn't appear in display
  • During display step repository is reset to initial state before pushing commits


  • Even by removing Git history, Github don't delete no more existing contribution from display.
  • By deleting project display is sometime reseted but this is very random
  • The only reliable way I found is to delete Github account and recreate it but this is really painfull
  • I tried to perform differential display by using colors ( ie activity frequency) but Github sum statistics despite history overload. Distance between number of contributions for 2 different colors must grow exponentially which implies the same for commit numbers
  • Software can be used on Gitlab but on this website activity display relies on push instead of commits and I don't think we can control push date ( server timestamp ? )


  • Mandatory parameter
    • BMP file containing pattern to display
  • Optionnal parameters:
    • --remote : Repository URL with type<user>/<project>.git
    • --email : Github account email used in commits
    • --dedicated_account : specify if we use a Github account that is not our default. If yes it will generate a new SSH configuration file to use a dedicated SSH Key
    • --key_file : name of file containing SSH private key used in case of dedicated account

Exemple :

./bin/github_display.exe --dedicated_account=yes --key_file=githubdisplay_id_rsa color.bmp 

How to test ?

Here is the procedure to follow:

  • Create a Github account
  • Add an SSH Key
  • Create a project
  • Create a BMP file defining your pattern by using provided example ( Bottom line is not taken in account. It is just there to define color palette)
  • Launch software by replacing example command parameters with values corresponding to your Github account/projet/email etc
  • Refresh you Github account webpage, normally the contribution activity should display your pattern