Skip to content
Switch branches/tags


Failed to load latest commit information.
Latest commit message
Commit time




  • Code is written in scala, C++ and perl.
  • For scala code, use sbt to build and run programs. It is the easiest
  • This code has only being tested under Linux, but it should run under MacOS


srcml sure srcml is in path
ctags sure ctags is in path
bfg this branch


  • obtain the above bfg branch
git clone --branch blobexec
  • build in the bfg root directory


For each module, its dependencies are documented in their corresponding file.

As an example, on Debian 9 the following packages must be installed: cmake libarchive-dev libxml++2.6-dev libxml2-dev libcurl4-openssl-dev libxslt1-dev libboost-all-dev libantlr-dev libssl-dev libxerces-c-dev exuberant-ctags libdbi-perl libjgit-java libhtml-fromtext-perl libset-scalar-perl libdbd-sqlite3-perl

How to build

  • compile slickGitLog, persons, remapCommits with sbt in their directories (sbt can be found at repo)

sbt one-jar
  • use make to compile srcMLtoken
  • perl scripts can be run without compilation

How to use

This is the workflow to process a git repository with cregit, and to generate the HTML views of its contributions.

  • It assumes that the cregit-repository will be created in /tmp/xournal
  • The original repository is located at /home/dmg/git.hacking.mine/xournal

a. Create the view repository.

To tokenize the files we require to create some environment variables to communicate with the tokenizing script

BFG_MEMO_DIRdirectory to use for memoization of tokenized files
BFG_TOKENIZE_CMDcommand to use to tokenize, might include parameters


  • use the tokenizeByBlobId/ to do the tokenization
  • will execute
./ --srcml2token=<path to srcml2token> --srcml=<path to srcml> --ctags=<path to ctags>

Run it as:

export BFG_MEMO_DIR=/tmp/memo
export BFG_TOKENIZE_CMD=/home/dmg/git.dmg/cregit-scala/tokenize/ --srcml2token=/home/dmg/git.dmg/cregit-scala/tokenize/srcMLtoken/srcml2token --srcml=srcml --ctags=/usr/local/bin/ctags
java -jar bfg-cregit.jar '--blob-exec:/home/dmg/git.dmg/cregit-scala/tokenizeByBlobId/[ch]$' --no-blob-protection /path/repo

b. Create the history database for the original repo

java -jar slickGitLog.jar /tmp/xournal-original.db /home/dmg/git.hacking.mine/xournal

c. Create the history database for the cregit repo

java -jar slickGitLog.jar /tmp/xournal-cregit.db /tmp/xournal

d. Create the persons database

java -jar persons.jar /home/dmg/git.hacking.mine/xournal /tmp/xournal.xls /tmp/xournal-persons.db

e. Create blame of cregit files

perl --verbose --formatBlame=./ /tmp/xournal /tmp/blame '\.[ch]$'

f. create the table with the map from newcommits to commits

java -jar remapCommits.jar /tmp/xournal-cregit.db /tmp/xournal

g. Create html version of the files


perl ./ --verbose /tmp/xournal-cregit.db /tmp/xournal-persons.db ~/git.hacking.mine/xournal /tmp/blame /tmp/html '\.[ch]$'


The license of Cregit is GPL-3.0+


  • create temporary files in TMP proper location
  • use preferred name in html files
  • create a driver program for processing an entire repository
  • customize programs to read a JSON file with configuration?