Giter Club home page Giter Club logo

cregit's Introduction

readme

./logos/cregit.png

Preliminaries

  • 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

Prerequisites

srmlhttp://www.srcml.org/Make sure srml is in the path
bfghttps://github.com/rtyley/bfg-repo-cleanerIt needs to be patched. see below

bfg

  1. you must fork bfg
  2. apply the patch found in the directory bfg.
  3. build

Dependencies:

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

How to build

  • use sbt to compile the scala code
  • use make to compile the C++ code
  • 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

Example:

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

Run it as:

export BFG_MEMO_DIR=/tmp/memo
export BFG_TOKENIZE_CMD=/home/dmg/git.dmg/cregit-scala/tokenize/tokenizeSrcMl.pl --srcml2token=/home/dmg/git.dmg/cregit-scala/tokenize/srcMLtoken/srcml2token --srcml=srcml --ctags=ctags-exuberant
java -jar bfg-cregit.jar '--blob-exec:/home/dmg/git.dmg/cregit-scala/tokenizeByBlobId/tokenBySha.pl=.[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 blameRepoFiles.pl --verbose --formatBlame=./formatBlame.pl /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

Example:

perl ./prettyPrintFiles.pl --verbose /tmp/xournal-cregit.db /tmp/xournal-persons.db ~/git.hacking.mine/xournal /tmp/blame /tmp/html https://github.com/dmgerman/xournal-next/commit/ '\.[ch]$' 

License

The license of Cregit is GPL-3.0+

TODO

  • 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?

cregit's People

Contributors

dmgerman avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.