Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

qf28/git2json

Open more actions menu
 
 

Repository files navigation

Git2JSON

https://badge.fury.io/py/git2json.png https://travis-ci.org/tarmstrong/git2json.png?branch=master https://pypip.in/d/git2json/badge.png

Convert git logs to JSON for easier analysis.

Installation

The easiest way to install git2json is through pip:

pip install git2json

If you want the most up-to-date version (at a greater risk of encountering bugs) you can clone this repository and install it manually:

git clone https://github.com/tarmstrong/git2json.git
cd git2json
python setup.py install

Usage

usage: git2json [-h] [--git-dir GIT_DIR] [--since SINCE]

optional arguments:
  -h, --help         show this help message and exit
  --git-dir GIT_DIR  Path to the .git/ directory of the repository you are
                     targeting
  --since SINCE      Show commits more recent than a specific date. If
                     present, this argument is passed through to "git log"
                     unchecked.

usage: git2json [-h] [--git-dir GIT_DIR]

The resulting JSON log is printed to standard output.

Example JSON

The following shows the structure of the JSON emitted by the tool.

[{
    "committer": {
        "date": 1379903278,
        "timezone": "-0400",
        "name": "Tavish Armstrong",
        "email": "tavisharmstrong@gmail.com"
    },
    "parents": ["e307663594031738c932877c8589552d5aafc953"],
    "author": {
        "date": 1379903278,
        "timezone": "-0400",
        "name": "Tavish Armstrong",
        "email": "tavisharmstrong@gmail.com"
    },
    "tree": "bd03127651335e3a51241f507f3bf194d8336485",
    "commit": "d06454c160218b4a782afad2429abda1add54df0",
    "message": "Allow user to specify git-dir on the command line.",
    "changes": [
        [23, 3, "git2json/__init__.py"]
    ]
    },
    // ... More commits
    ]

Usage Examples

If you are using git2json in interesting ways, please share and I will add your notebooks/blog posts/code to this list.

About

Convert git logs to JSON for easy analysis

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 90.2%
  • Makefile 9.8%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.