Skip to content
πŸ’Š A git query language
Go Shell Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Run tests on pull requests (#91) Nov 11, 2019
lexical Add support to count commits (#80) Feb 18, 2019
parser Add support to count commits (#80) Feb 18, 2019
runtime Prepare v2.0.0 (#88) Oct 28, 2019
semantical Add support to count commits (#80) Feb 18, 2019
utilities Move fieldContains method to the new utilities package. Oct 21, 2017
.gitignore Add support to release gitql as a static file (#84) Oct 7, 2019
Dockerfile Add support to release gitql as a static file (#84) Oct 7, 2019
LICENSE
Makefile Add install libgit script (#86) Oct 11, 2019
README.md Add support to static binaries (windows/linux amd64) (#87) Oct 27, 2019
autocomplete.go Complete autocomplete_test.go and Simplifying autocomplete.go Dec 28, 2016
autocomplete_test.go Complete autocomplete_test.go and Simplifying autocomplete.go Dec 28, 2016
cmd.go Prepare v2.0.0 (#88) Oct 28, 2019
gitql.go
go.mod Add support to release gitql as a static file (#84) Oct 7, 2019
go.sum Add support to release gitql as a static file (#84) Oct 7, 2019
howtouse.gif Speedup gif (#90) Nov 9, 2019
install-libgit2.sh Add install libgit script (#86) Oct 11, 2019
install.sh Add support to static binaries (windows/linux amd64) (#87) Oct 27, 2019
tables.md Prepare v2.0.0 (#88) Oct 28, 2019

README.md

Gitql

Gitql is a Git query language.

In a repository path...

how to use

See more here

Requirements

  • Go
  • cmake
  • pkg-config

How to install

We support static compiling for linux and windows platform (amd64), so you can access the releases page and just grab the binary. If you want to compile itself follow the instructions below:

linux/amd64

Read the dockerfile to understand the whole process.

darwin/amd64

We do not support yet static compiling. You need to have pkg-config as dependencies, so after install that, run

# Inside this repository folder
export PKG_CONFIG_PATH=${PWD}/libgit2/install/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(PWD)/libgit2/install/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$(PWD)/libgit2/install/lib
make build-dynamic

windows/amd64

You need a C compiler, Cmake and Ninja installed. Using chocolately it should be easy

choco install cmake ninja vcredist2017
set PATH=%HOMEDRIVE%\mingw64\bin;%PATH%
make build

You can always take a look in our github actions file to understand how we build it in the ci server. If even after try the binaries or either compile yourself you couldn't use that. Open an issue.

Examples

gitql "your query"
or
git ql "your query"

As an example, this is the commits table:

commits
author
author_email
committer
committer_email
hash
date
message
full_message

(see more tables here)

Example Commands

  • select hash, author, message from commits limit 3
  • select hash, message from commits where 'hell' in full_message or 'Fuck' in full_message
  • select hash, message, author_email from commits where author = 'cloudson'
  • select date, message from commits where date < '2014-04-10'
  • select message from commits where 'hell' in message order by date asc

Questions?

gitql or open an issue

Notes:

  • Gitql doesn't want to kill git log - it was created just for science! πŸ˜…
  • It's read-only - no deleting, inserting, or updating tables or commits. 😝
  • The default limit is 10 rows.
  • It's inspired by textql.
  • Gitql is a compiler/interpreter instead of just read a sqlite database with all commits, tags, etc. because we would need to sync the tables every time before run sql and we would have sqlite bases for each repository. 😐
You can’t perform that action at this time.