• Stars
    star
    3,449
  • Rank 12,942 (Top 0.3 %)
  • Language
    Go
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. πŸ” πŸ“Š

Go Reference BuildStatus Go Report Card TODOs codecov Twitter Follow

mergestat-lite MergeStat Logo

mergestat-lite is a command-line tool for running SQL queries on git repositories and related data sources. It's meant for ad-hoc querying of source-code on disk through a common interface (SQL), as an alternative to patching together various shell commands. It can execute queries that look like:

-- how many commits have been authored by [email protected]?
SELECT count(*) FROM commits WHERE author_email = '[email protected]'

It installs a binary named mergestat.

More in-depth examples and documentation can be found on our dedicated documentation site.

Join our community on Slack if you have questions, or just to say hi πŸŽ‰.

Installation

See the full instructions in our documentation.

Homebrew

brew tap mergestat/mergestat
brew install mergestat

Docker

docker run -v "${PWD}:/repo" mergestat/mergestat "select count(*) from commits"

Examples

SQL queries can be executed in the CLI on local or remote git repositories. Remote repos are cloned to a temporary directory at runtime.

CLI SQL Screenshot

The --format flag can be used to output json, ndjson, csv and more (see mergestat -h). This can be useful for piping/using with other tools.

Higher level commands such as mergestat summarize commits generate reports without requiring a SQL input. Learn more here about the available flags such as --start to change the date range and --json to output as JSON.

CLI Summarize Commits Screenshot

Learn more in our docs

More Repositories

1

mergestat

MergeStat enables anyone to ask questions about the history and contents of source code.
TypeScript
461
star
2

timediff

Go library for printing human readable, relative time differences πŸ•°οΈ
Go
391
star
3

scribe

Command line interface for translating natural language prompts into SQL queries using the OpenAI API
Go
34
star
4

treequery

Run Tree-sitter queries on source code
Go
24
star
5

fluentgraphql

Fluent GraphQL client library in Golang
Go
20
star
6

go-mysql-sqlite-server

Experimental implementation of a SQLite backend for go-mysql-server
Go
18
star
7

termbar

Generate terminal charts in Go πŸ“Š
Go
18
star
8

dblite

SQLite extension for accessing other SQL databases, in SQLite
Go
11
star
9

pqueue

Go library for using PostgreSQL as a job queue
Go
7
star
10

gitutils

Golang library for programmatically working with the git command (via the os/exec package).
Go
7
star
11

mysql-server

Query git repositories as MySQL
Go
6
star
12

mergestat-git-dbt

Example dbt project showcasing various uses of git stats data from MergeStat
6
star
13

kyc

kyc is a tool for deriving facts about source code in a git repo
Go
6
star
14

syncs

MergeStat container based syncs
TypeScript
5
star
15

helm-charts

Helm charts for MergeStat capabilities
Smarty
4
star
16

blocks

Mergestat UI Components
TypeScript
4
star
17

gitgoperfs

For comparing the relative performance of interacting with git from go using go-git, git2go and parsing output of the git command.
Go
4
star
18

git-delivery

Serve files from git repositories over HTTP
Go
4
star
19

haystack

Haystack (as in, "finding a needle in a haystack") is a Go library for searching the contents of git repositories, backed by SQLite.
Go
3
star
20

sqlq

sqlq is a SQL-backed, persistent, job queuing solution.
Go
2
star
21

sqlc-compile-bug

1
star
22

fuse-examples-screenshots

1
star
23

docs

MergeStat documentation site
JavaScript
1
star
24

homebrew-mergestat

Brew Formula for the MergeStat CLI
Ruby
1
star
25

homebrew-treequery

Ruby
1
star
26

askgit-docs

1
star
27

blocks-legacy

React UI kit for MergeStat web interfaces
TypeScript
1
star
28

broker-proto

gRPC protobuf for the MergeStat broker
Go
1
star
29

bulk

CLI for running bulk actions (ad-hoc scripts) on sets of Git repositories
Go
1
star
30

homebrew-scribe

Ruby
1
star