mergestat-lite

command module
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 1 Imported by: 0

README

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 user@email.com?
SELECT count(*) FROM commits WHERE author_email = 'user@email.com'

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
Package extensions provide implementation of the various underlying sqlite3 virtual tables [https://www.sqlite.org/vtab.html] and user defined functions that mergestat uses under-the-hood.
Package extensions provide implementation of the various underlying sqlite3 virtual tables [https://www.sqlite.org/vtab.html] and user defined functions that mergestat uses under-the-hood.
internal/git/native
Package native provides virtual table implementations for git tables using libgit2 via the git2go bindings (https://github.com/libgit2/git2go).
Package native provides virtual table implementations for git tables using libgit2 via the git2go bindings (https://github.com/libgit2/git2go).
internal/npm
Package npm implements functions for iteracting with the npm registry
Package npm implements functions for iteracting with the npm registry
internal/tools
Package tools provides utilities to help with writing integration test suites for mergestat sqlite module.
Package tools provides utilities to help with writing integration test suites for mergestat sqlite module.
services
Package services provide types and interfaces that defines the various abstract services that different virtual module implementations depend upon.
Package services provide types and interfaces that defines the various abstract services that different virtual module implementations depend upon.
pkg
locator
Package locator provides various different implementations of git.RepoLocator service.
Package locator provides various different implementations of git.RepoLocator service.
mailmap
Package mailmap implements a basic git mailmap parser.
Package mailmap implements a basic git mailmap parser.
sqlite
Package sqlite provides a golang target that depends on sqlite's C amalgamation file.
Package sqlite provides a golang target that depends on sqlite's C amalgamation file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL