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

Overview

Go Reference BuildStatus Go Report Card TODOs codecov

askgit AskGit Logo

askgit is a command-line tool for running SQL queries on git repositories. It's meant for ad-hoc querying of git repositories 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]'

You can try queries on public git repositories without installing anything at https://try.askgit.com/

More in-depth examples and documentation can be found below. Also checkout our newsletter to stay up to date with feature releases and interesting queries and use cases.

Installation

Homebrew

brew tap askgitdev/askgit
brew install askgit

Pre-Built Binaries

The latest releases should have pre-built binaries for Mac and Linux. You can download and add the askgit binary somewhere on your $PATH to use. libaskgit.so is also available to be loaded as a SQLite run-time extension.

Go

libgit2 is a build dependency (used via git2go) and must be available on your system for linking.

The following (long ๐Ÿ˜ฌ ) go install commands can be used to install a binary via the go toolchain.

On Mac:

CGO_CFLAGS=-DUSE_LIBSQLITE3 CGO_LDFLAGS=-Wl,-undefined,dynamic_lookup go install -tags="sqlite_vtable,vtable,sqlite_json1,static,system_libgit2" github.com/askgitdev/[email protected]

On Linux:

CGO_CFLAGS=-DUSE_LIBSQLITE3 CGO_LDFLAGS=-Wl,--unresolved-symbols=ignore-in-object-files go install -tags="sqlite_vtable,vtable,sqlite_json1,static,system_libgit2" github.com/askgitdev/[email protected]

See the Makefile for more context. Checking out this repository and running make in the root will produce two files in the .build directory:

  1. askgit - the CLI binary (which can then be moved into your $PATH for use)
  2. libaskgit.so - a shared object file SQLite extension that can be used by SQLite directly

Using Docker

Build an image locally using docker

docker build -t askgit:latest .

Or use an official image from docker hub

docker pull augmentable/askgit:latest

Running commands

askgit operates on a git repository. This repository needs to be attached as a volume. This example uses the (bash) built-in command pwd for the current working directory

[pwd] Print the absolute pathname of the current working directory.

docker run --rm -v `pwd`:/repo:ro augmentable/askgit "SELECT * FROM commits"

Running commands from STDIN

For piping commands via STDIN, the docker command needs to be told to run non-interactively, as well as attaching the repository at /repo.

cat query.sql | docker run --rm -i -v `pwd`:/repo:ro augmentable/askgit

Public API

We maintain a free to use, public API for running queries (executed in an AWS Lambda function). See this page for more information.

Usage

askgit -h

Will output the most up to date usage instructions for your version of the CLI. Typically the first argument is a SQL query string:

askgit "SELECT * FROM commits"

Your current working directory will be used as the path to the git repository to query by default. Use the --repo flag to specify an alternate path, or even a remote repository reference (http(s) or ssh). askgit will clone the remote repository to a temporary directory before executing a query.

You can also pass a query in via stdin:

cat query.sql | askgit

By default, output will be an ASCII table. Use --format json or --format csv for alternatives. Use -v to print execution logs to stderr. This can be useful for understanding what API calls a query may be making, or similar runtime information. See -h for all the options.

Tables and Functions

Local Git Repository

The following tables access a git repository in the current directory by default. If the --repo flag is specified, they will use the path provided there instead. A parameter (usually the first) can also be provided to any of the tables below to override the default repo path. For instance, SELECT * FROM commits('https://github.com/askgitdev/askgit') will clone this repo to a temporary directory on disk and return its commits.

commits

Similar to git log, the commits table includes all commits in the history of the currently checked out commit.

Column Type
hash TEXT
message TEXT
author_name TEXT
author_email TEXT
author_when DATETIME
committer_name TEXT
committer_email TEXT
committer_when DATETIME
parents INT

Params:

  1. repository - path to a local (on disk) or remote (http(s)) repository
  2. rev - return commits starting at this revision (i.e. branch name or SHA), defaults to HEAD
-- return all commits starting at HEAD
SELECT * FROM commits

-- specify an alternative repo on disk
SELECT * FROM commits('/some/path/to/repo')

-- clone a remote repo and use it
SELECT * FROM commits('https://github.com/askgitdev/askgit')

-- use the default repo, but provide an alternate branch
SELECT * FROM commits('', 'some-ref')
refs
Column Type
name TEXT
type TEXT
remote TEXT
full_name TEXT
hash TEXT
target TEXT

Params:

  1. repository - path to a local (on disk) or remote (http(s)) repository
stats
Column Type
file_path TEXT
additions INT
deletions INT

Params:

  1. repository - path to a local (on disk) or remote (http(s)) repository
  2. rev - commit hash (or branch/tag name) to use for retrieving stats, defaults to HEAD
  3. to_rev - commit hash to calculate stats relative to
-- return stats of HEAD
SELECT * FROM stats

-- return stats of a specific commit
SELECT * FROM stats('', 'COMMIT_HASH')

-- return stats for every commit in the current history
SELECT commits.hash, stats.* FROM commits, stats('', commits.hash)
files
Column Type
path TEXT
executable BOOL
contents TEXT

Params:

  1. repository - path to a local (on disk) or remote (http(s)) repository
  2. rev - commit hash (or branch/tag name) to use for retrieving files in, defaults to HEAD
blame

Similar to git blame, the blame table includes blame information for all files in the current HEAD.

Column Type
line_no INT
commit_hash TEXT

Params:

  1. repository - path to a local (on disk) or remote (http(s)) repository
  2. rev - commit hash (or branch/tag name) to use for retrieving blame information from, defaults to HEAD
  3. file_path - path of file to blame

Utilities

JSON

The SQLite JSON1 extension is included for working with JSON data.

toml_to_json

Scalar function that converts toml to json.

SELECT toml_to_json('[some-toml]')

-- +-----------------------------+
-- | TOML_TO_JSON('[SOME-TOML]') |
-- +-----------------------------+
-- | {"some-toml":{}}            |
-- +-----------------------------+
xml_to_json

Scalar function that converts xml to json.

SELECT xml_to_json('
   
    hello
   ')

-- +-------------------------------------------+
-- | XML_TO_JSON('
   
    HELLO
   ') |
-- +-------------------------------------------+
-- | {"some-xml":"hello"}                      |
-- +-------------------------------------------+
yaml_to_json and yml_to_json

Scalar function that converts yaml to json.

SELECT yaml_to_json('hello: world')

-- +------------------------------+
-- | YAML_TO_JSON('HELLO: WORLD') |
-- +------------------------------+
-- | {"hello":"world"}            |
-- +------------------------------+
go_mod_to_json

Scalar function that parses a go.mod file and returns a JSON representation of it.

SELECT go_mod_to_json('
   
    '
   )
str_split

Helper for splitting strings on some separator.

SELECT str_split('hello,world', ',', 0)

-- +----------------------------------+
-- | STR_SPLIT('HELLO,WORLD', ',', 0) |
-- +----------------------------------+
-- | hello                            |
-- +----------------------------------+
SELECT str_split('hello,world', ',', 1)

-- +----------------------------------+
-- | STR_SPLIT('HELLO,WORLD', ',', 1) |
-- +----------------------------------+
-- | world                            |
-- +----------------------------------+

Enry Functions

Functions from the enry project are also available as SQL scalar functions

enry_detect_language

Supply a file path and some source code to detect the language.

SELECT enry_detect_language('some/path/to/file.go', '
   
    '
   )
enry_is_binary

Given a blob, determine if it's a binary file or not (returns 1 or 0).

SELECT enry_is_binary('
   
    '
   )
enry_is_configuration

Detect whether a file path is to a configuration file (returns 1 or 0).

SELECT enry_is_configuration('some/path/to/file/config.json')
enry_is_documentation

Detect whether a file path is to a documentation file (returns 1 or 0).

SELECT enry_is_documentation('some/path/to/file/README.md')
enry_is_dot_file

Detect whether a file path is to a dot file (returns 1 or 0).

SELECT enry_is_dot_file('some/path/to/file/.gitignore')
enry_is_generated

Detect whether a file path is generated (returns 1 or 0).

SELECT enry_is_generated('some/path/to/file/generated.go', '
   
    '
   )
enry_is_image

Detect whether a file path is to an image (returns 1 or 0).

SELECT enry_is_image('some/path/to/file/image.png')
enry_is_test

Detect whether a file path is to a test file (returns 1 or 0).

SELECT enry_is_test('some/path/to/file/image.png')
enry_is_vendor

Detect whether a file path is to a vendored file (returns 1 or 0).

SELECT enry_is_vendor('vendor/file.go')

GitHub API

You can use askgit to query the GitHub API (v4). Constraints in your SQL query are pushed to the GitHub API as much as possible. For instance, if your query includes an ORDER BY clause and if items can be ordered in the GitHub API response (on the specified column), your query can avoid doing a full table scan and rely on the ordering returned by the API.

Authenticating

You must provide an authentication token in order to use the GitHub API tables. You can create a personal access token following these instructions. askgit will look for a GITHUB_TOKEN environment variable when executing, to use for authentication. This is also true if running as a runtime loadable extension.

Rate Limiting

All API requests to GitHub are rate limited. The following tables make use of the GitHub GraphQL API (v4), which rate limits additionally based on the "complexity" of GraphQL queries. Generally speaking, the more fields/relations in your GraphQL query, the higher the "cost" of a single API request, and the faster you may reach a rate limit. Depending on your SQL query, it's hard to know ahead of time what a good client-side rate limit is. By default, each of the tables below will fetch 100 items per page and permit 2 API requests per second. You can override both of these parameters by setting the following environment variables:

  1. GITHUB_PER_PAGE - expects an integer between 1 and 100, sets how many items are fetched per-page in API calls that paginate results.
  2. GITHUB_RATE_LIMIT - expressed in the form (number of requests) / (number of seconds) (i.e. 1/3 means at most 1 request per 3 seconds)

If you encounter a rate limit error that looks like You have exceeded a secondary rate limit, consider setting the GITHUB_PER_PAGE value to a lower number. If you have a large number of items to scan in your query, it may take longer, but you should avoid hitting a rate limit error.

github_stargazers

Table-valued-function that returns a list of users who have starred a repository.

Column Type
login TEXT
email TEXT
name TEXT
bio TEXT
company TEXT
avatar_url TEXT
created_at DATETIME
updated_at DATETIME
twitter TEXT
website TEXT
location TEXT
starred_at DATETIME

Params:

  1. fullNameOrOwner - either the full repo name askgitdev/askgit or just the owner askgit (which would require the second argument)
  2. name - optional if the first argument is a "full" name, otherwise required - the name of the repo
SELECT * FROM github_stargazers('askgitdev', 'askgit');
SELECT * FROM github_stargazers('askgitdev/askgit'); -- both are equivalent
github_starred_repos

Table-valued-function that returns a list of repositories a user has starred.

Column Type
name TEXT
url TEXT
description TEXT
created_at DATETIME
pushed_at DATETIME
updated_at DATETIME
stargazer_count INT
name_with_owner TEXT
starred_at DATETIME

Params:

  1. login - the login of a GitHub user
SELECT * FROM github_starred_repos('patrickdevivo')
github_stargazer_count

Scalar function that returns the number of stars a GitHub repository has.

Params:

  1. fullNameOrOwner - either the full repo name askgitdev/askgit or just the owner askgit (which would require the second argument)
  2. name - optional if the first argument is a "full" name, otherwise required - the name of the repo
SELECT github_stargazer_count('askgitdev', 'askgit');
SELECT github_stargazer_count('askgitdev/askgit'); -- both are equivalent
github_user_repos and github_org_repos

Table-valued function that returns all the repositories belonging to a user or an organization.

Column Type
created_at DATETIME
database_id INT
default_branch_ref_name TEXT
default_branch_ref_prefix TEXT
description TEXT
disk_usage INT
fork_count INT
homepage_url TEXT
is_archived BOOLEAN
is_disabled BOOLEAN
is_fork BOOLEAN
is_mirror BOOLEAN
is_private BOOLEAN
issue_count INT
latest_release_author TEXT
latest_release_created_at DATETIME
latest_release_name TEXT
latest_release_published_at DATETIME
license_key TEXT
license_name TEXT
name TEXT
open_graph_image_url TEXT
primary_language TEXT
pull_request_count INT
pushed_at DATETIME
release_count INT
stargazer_count INT
updated_at DATETIME
watcher_count INT

Params:

  1. login - the login of a GitHub user or organization
SELECT * FROM github_user_repos('patrickdevivo')
SELECT * FROM github_org_repos('askgitdev')
github_repo_issues

Table-valued-function that returns all the issues of a GitHub repository.

Column Type
owner TEXT
reponame TEXT
author_login TEXT
body TEXT
closed BOOLEAN
closed_at DATETIME
comment_count INT
created_at DATETIME
created_via_email BOOLEAN
database_id TEXT
editor_login TEXT
includes_created_edit BOOLEAN
label_count INT
last_edited_at DATETIME
locked BOOLEAN
milestone_count INT
number INT
participant_count INT
published_at DATETIME
reaction_count INT
state TEXT
title TEXT
updated_at DATETIME
url TEXT

Params:

  1. fullNameOrOwner - either the full repo name askgitdev/askgit or just the owner askgit (which would require the second argument)
  2. name - optional if the first argument is a "full" name, otherwise required - the name of the repo
SELECT * FROM github_repo_issues('askgitdev/askgit');
SELECT * FROM github_repo_issues('askgitdev', 'askgit'); -- both are equivalent
github_repo_prs

Table-valued-function that returns all the pull requests of a GitHub repository.

Column Type
additions INT
author_login TEXT
author_association TEXT
base_ref_oid TEXT
base_ref_name TEXT
base_repository_name TEXT
body TEXT
changed_files INT
closed BOOLEAN
closed_at DATETIME
comment_count INT
commit_count INT
created_at TEXT
created_via_email BOOLEAN
database_id INT
deletions INT
editor_login TEXT
head_ref_name TEXT
head_ref_oid TEXT
head_repository_name TEXT
is_draft INT
label_count INT
last_edited_at DATETIME
locked BOOLEAN
maintainer_can_modify BOOLEAN
mergeable TEXT
merged BOOLEAN
merged_at DATETIME
merged_by TEXT
number INT
participant_count INT
published_at DATETIME
review_decision TEXT
state TEXT
title TEXT
updated_at DATETIME
url TEXT

Params:

  1. fullNameOrOwner - either the full repo name askgitdev/askgit or just the owner askgit (which would require the second argument)
  2. name - optional if the first argument is a "full" name, otherwise required - the name of the repo
SELECT * FROM github_repo_prs('askgitdev/askgit');
SELECT * FROM github_repo_prs('askgitdev', 'askgit'); -- both are equivalent
github_repo_file_content

Scalar function that returns the contents of a file in a GitHub repository

Params:

  1. fullNameOrOwner - either the full repo name askgitdev/askgit or just the owner askgit (which would require the second argument)
  2. name - optional if the first argument is a "full" name, otherwise required - the name of the repo
  3. expression - either a simple file path (README.md) or a rev-parse suitable expression that includes a path (HEAD:README.md or :README.md )
SELECT github_stargazer_count('askgitdev', 'askgit', 'README.md');
SELECT github_stargazer_count('askgitdev/askgit', 'README.md'); -- both are equivalent

Sourcegraph API (experimental!)

You can use askgit to query the Sourcegraph API.

Authenticating

You must provide an authentication token in order to use the Sourcegraph API tables. You can create a personal access token following these instructions. askgit will look for a SOURCEGRAPH_TOKEN environment variable when executing, to use for authentication. This is also true if running as a runtime loadable extension.

sourcegraph_search

Table-valued-function that returns results from a Sourcegraph search.

Column Type
__typename TEXT
results TEXT

__typename will be one of Repository, CommitSearchResult, or FileMatch. results will be the JSON value of a search result (will match what's returned from the API)

Params:

  1. query - a sourcegraph search query (docs)
SELECT sourcegraph_search('askgit');

NPM Registry

askgit can also query the NPM registry API.

npm_get_package

Scalar function that queries https://registry.npmjs.org/< > or https://registry.npmjs.org/< >/< > (depending on number of params) and returns the JSON response.

Params:

  1. package - name of the NPM package
  2. version - (optional) package version
SELECT npm_get_package('jquery')
SELECT npm_get_package('jquery', 'latest')

Example Queries

This will return all commits in the history of the currently checked out branch/commit of the repo.

SELECT * FROM commits

Return the (de-duplicated) email addresses of commit authors:

SELECT DISTINCT author_email FROM commits

Return the commit counts of every author (by email):

SELECT author_email, count(*) FROM commits GROUP BY author_email ORDER BY count(*) DESC

Same as above, but excluding merge commits:

SELECT author_email, count(*) FROM commits WHERE parents < 2 GROUP BY author_email ORDER BY count(*) DESC

Outputs the set of files in the current tree:

SELECT * FROM files

Returns author emails with lines added/removed, ordered by total number of commits in the history (excluding merges):

SELECT count(DISTINCT commits.hash) AS commits, SUM(additions) AS additions, SUM(deletions) AS deletions, author_email
FROM commits LEFT JOIN stats('', commits.hash)
WHERE commits.parents < 2
GROUP BY author_email ORDER BY commits

Returns commit counts by author, broken out by day of the week:

SELECT
    count(*) AS commits,
    count(CASE WHEN strftime('%w',author_when)='0' THEN 1 END) AS sunday,
    count(CASE WHEN strftime('%w',author_when)='1' THEN 1 END) AS monday,
    count(CASE WHEN strftime('%w',author_when)='2' THEN 1 END) AS tuesday,
    count(CASE WHEN strftime('%w',author_when)='3' THEN 1 END) AS wednesday,
    count(CASE WHEN strftime('%w',author_when)='4' THEN 1 END) AS thursday,
    count(CASE WHEN strftime('%w',author_when)='5' THEN 1 END) AS friday,
    count(CASE WHEN strftime('%w',author_when)='6' THEN 1 END) AS saturday,
    author_email
FROM commits GROUP BY author_email ORDER BY commits

Exporting

You can use the askgit export sub command to save the output of queries into a sqlite database file. The command expects a path to a db file (which will be created if it doesn't already exist) and a variable number of "export pairs," specified by the -e flag. Each pair represents the name of a table to create and a query to generate its contents.

askgit export my-export-file -e commits -e "SELECT * FROM commits" -e files -e "SELECT * FROM files"

This can be useful if you're looking to use another tool to examine the data emitted by askgit. Since the exported file is a plain SQLite database, queries should be much faster (as the original git repository is no longer traversed) and you should be able to use any tool that supports querying SQLite database files.

Comments
  • Following installation instructions doesn't work?

    Following installation instructions doesn't work?

    I'm not very familiar with Go, so perhaps I'm doing something wrong?

    $ go install -v -tags=sqlite_vtable github.com/augmentable-dev/gitqlite
    can't load package: package github.com/augmentable-dev/gitqlite: cannot find package "github.com/augmentable-dev/gitqlite" in any of:
            /usr/lib/go-1.10/src/github.com/augmentable-dev/gitqlite (from $GOROOT)
            /home/erez/go/src/github.com/augmentable-dev/gitqlite (from $GOPATH)
    
    opened by erezsh 12
  • Is there a query to extract file content on a specific date?

    Is there a query to extract file content on a specific date?

    Hi to all, imagine I have repo in which I update a txt file day by day.

    Is there a way to have the version of this file on 2021-12-21?

    A query like SELECT * FROM myFile.txt AS OF TIMESTAMP('2021-12-21'); that give me in output that file at that date?

    Thank you

    opened by aborruso 8
  • Took very long time on the first run

    Took very long time on the first run

    Is it expected that the basic command from README is so heavy? I initially thought that there's something wrong with my invocation, I did this:

    docker run --rm -v `pwd`:/repo:ro augmentable/askgit "SELECT * FROM commits"
    

    Then my computer just seemed to be stuck. I was seeing resource usage like this for over a minute:

    Screenshot 2020-08-30 at 10 02 57

    Then it eventually finished after about 2.5 minutes but I was seriously worried that I'm doing something wrong, e.g., not escaping the SQL query correctly.

    What does it do on the first run? Is it building some sort of database behind the scenes? Would even "simpler" queries like SELECT count(*) FROM commits take similarly long?

    opened by borekb 6
  • Installation is broken with Homebrew

    Installation is broken with Homebrew

    Upgrading askgitdev/askgit/askgit with Homebrew on Linux (Ubuntu 20.04) is failing:

    > uname -srm
    Linux 5.14.11-051411-generic x86_64
    
    > lsb_release -d
    Description:    Ubuntu 20.04.3 LTS
    
    > brew outdated
    askgitdev/askgit/askgit (v0.4.7) < v0.4.8
    
    > brew upgrade
    ==> Auto-updated Homebrew!
    Updated 1 tap (homebrew/cask).
    ==> Updated Casks
    Updated 1 cask.
    
    Updating Homebrew...
    ==> Upgrading 1 outdated package:
    askgitdev/askgit/askgit v0.4.7 -> v0.4.8
    ==> Downloading https://github.com/askgitdev/askgit/archive/v0.4.8.tar.gz
    Already downloaded: /home/giermulnik/.cache/Homebrew/downloads/bc83f30eb7ec1aa03e0e8e020c5cd9006e5ccb1da98eb05d36d61777e2d14864--askgit-0.4.8.tar.gz
    ==> Upgrading askgitdev/askgit/askgit
      v0.4.7 -> v0.4.8
    
    ==> make
    Last 15 lines from /home/giermulnik/.cache/Homebrew/Logs/askgit/01.make:
    
    -- nuking .build/
    -- building .build/libaskgit.so
    -- building .build/askgit
    # github.com/libgit2/git2go/v32
    /home/giermulnik/.cache/Homebrew/go_mod_cache/pkg/mod/github.com/libgit2/git2go/[email protected]/Build_system_dynamic.go:12:3: error: #error "Invalid libgit2 version; this git2go supports libgit2 between v1.2.0 and v1.2.0"
       12 | # error "Invalid libgit2 version; this git2go supports libgit2 between v1.2.0 and v1.2.0"
          |   ^~~~~
    # github.com/libgit2/git2go/v32
    /home/giermulnik/.cache/Homebrew/go_mod_cache/pkg/mod/github.com/libgit2/git2go/[email protected]/Build_system_static.go:12:3: error: #error "Invalid libgit2 version; this git2go supports libgit2 between v1.2.0 and v1.2.0"
       12 | # error "Invalid libgit2 version; this git2go supports libgit2 between v1.2.0 and v1.2.0"
          |   ^~~~~
    make: *** [Makefile:17: .build/libaskgit.so] Error 2
    make: *** Waiting for unfinished jobs....
    make: *** [Makefile:23: .build/askgit] Error 2
    
    If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
      https://github.com/askgitdev/homebrew-askgit/issues
    
    > brew info libgit2
    libgit2: stable 1.3.0 (bottled), HEAD
    C library of Git core methods that is re-entrant and linkable
    https://libgit2.github.com/
    /home/linuxbrew/.linuxbrew/Cellar/libgit2/1.3.0 (102 files, 4.8MB) *
      Poured from bottle on 2021-10-01 at 00:16:35
    From: https://github.com/Homebrew/linuxbrew-core/blob/HEAD/Formula/libgit2.rb
    License: GPL-2.0-only
    ==> Dependencies
    Build: cmake โœ”, pkg-config โœ”
    Required: libssh2 โœ”
    ==> Options
    --HEAD
            Install HEAD version
    ==> Analytics
    install: 1,052 (30 days), 1,994 (90 days), 6,492 (365 days)
    install-on-request: 140 (30 days), 193 (90 days), 598 (365 days)
    build-error: 0 (30 days)
    
    opened by yermulnik 5
  • Issues with repository directories with special characters

    Issues with repository directories with special characters

    askgit has trouble with repository directories that contain characters that are either special to Go's %q string encoding or special to sqlite. Some characters cause askgit to exit with "unrecognized token" trying to create the virtual table, while others make it further and fail (or produce no data) when executing SQL statements.

    Some special characters do not render well on github, so I've included equivalent shell commands for making these directories.

    The following directories behave the same. select count(*) from commits returns no results (not the number 0 - it returns an empty resultset), while select count(*) from files panics with "panic: invalid handle":

    • back\slash (mkdir 'back\slash')
    • thing๏ท (mkdir 'thing'$'\357\267\220')
    • new line (mkdir 'new'$'\n''line')
    • doublequotes");--injection (mkdir 'doublequotes");--injection')

    The following directories all fail without running the SQL query, with an error like unrecognized token: "");":

    • quotation"marks (mkdir 'quotation"marks')
    • comma",separated" (mkdir 'comma",separated"')

    This seems to be caused by building a SQL string using fmt.Sprintf and %q, which quotes/escapes strings in a way that Go understands rather than in a way that sqlite understands. Go will format " in the middle of a string as \", which Sqlite considers to be a literal backslash character followed by the end of a string, which is why most directories with the double quote character result in "unrecognized token". For other characters it seems like Go will escape them (e.g. \ becomes \\, newline becomes \n), and Sqlite happily passes the escaped versions to the modules' Create functions, which presumably try and fail to open a directory named e.g. back\\slash instead of back\slash

    This can be reproduced in the tests by changing the fixture repo from "repo" to e.g. "repo\\" or "repo\""

    opened by nhinds 5
  • Add support for `.mailmap` files

    Add support for `.mailmap` files

    See here for context. It would be useful to be able use mappings in a .mailmap of a repo to de-duplicate authors in queries.

    I'm not entirely sure how we add support for it - maybe as a helper function that takes the contents of a .mailmap and an email address, and returns the associated name.

    Something like SELECT mailmap(<mailmap-contents>, '[email protected]')

    enhancement 
    opened by patrickdevivo 4
  • Install error: cannot find package

    Install error: cannot find package "github.com/libgit2/git2go/v30"

    When trying to install by running this:

    go get -v -tags=sqlite_vtable github.com/augmentable-dev/askgit
    

    I get this:

    โžœ go get -v -tags=sqlite_vtable github.com/augmentable-dev/askgit
    
    github.com/libgit2/git2go (download)
    cannot find package "github.com/libgit2/git2go/v30" in any of:
    	/usr/local/go/src/github.com/libgit2/git2go/v30 (from $GOROOT)
    	/home/duncan/.go/src/github.com/libgit2/git2go/v30 (from $GOPATH)
    

    My environment is as follows:

     โžœ go version
    go version go1.15.5 linux/amd64
    
    โžœ go env
    GO111MODULE=""
    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/home/duncan/.cache/go-build"
    GOENV="/home/duncan/.config/go/env"
    GOEXE=""
    GOFLAGS=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOINSECURE=""
    GOMODCACHE="/home/duncan/.go/pkg/mod"
    GONOPROXY=""
    GONOSUMDB=""
    GOOS="linux"
    GOPATH="/home/duncan/.go"
    GOPRIVATE=""
    GOPROXY="https://proxy.golang.org,direct"
    GOROOT="/usr/local/go"
    GOSUMDB="sum.golang.org"
    GOTMPDIR=""
    GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
    GCCGO="gccgo"
    AR="ar"
    CC="gcc"
    CXX="g++"
    CGO_ENABLED="1"
    GOMOD=""
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build228718343=/tmp/go-build -gno-record-gcc-switches"
    
     โžœ neofetch --backend off
    
    OS: Ubuntu 20.04.1 LTS x86_64 
    Kernel: 5.4.0-52-generic 
    Shell: bash 5.0.17 
    DE: Xfce 
    Memory: 38419MiB / 64206MiB 
    
    opened by dflock 4
  • Build fails looking for 'github.com/go-git/go-billy/v5/osfs'

    Build fails looking for 'github.com/go-git/go-billy/v5/osfs'

    Build log as follows:

    [email protected]:~/tmp$ go get -v -tags=sqlite_vtable github.com/augmentable-dev/askgit
    github.com/augmentable-dev/askgit (download)
    github.com/go-git/go-git (download)
    github.com/go-git/go-billy (download)
    Fetching https://golang.org/x/sys/unix?go-get=1
    Parsing meta tags from https://golang.org/x/sys/unix?go-get=1 (status code 200)
    get "golang.org/x/sys/unix": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at https://golang.org/x/sys/unix?go-get=1
    get "golang.org/x/sys/unix": verifying non-authoritative meta tag
    Fetching https://golang.org/x/sys?go-get=1
    Parsing meta tags from https://golang.org/x/sys?go-get=1 (status code 200)
    golang.org/x/sys (download)
    github.com/go-git/gcfg (download)
    Fetching https://gopkg.in/warnings.v0?go-get=1
    Parsing meta tags from https://gopkg.in/warnings.v0?go-get=1 (status code 200)
    get "gopkg.in/warnings.v0": found meta tag get.metaImport{Prefix:"gopkg.in/warnings.v0", VCS:"git", RepoRoot:"https://gopkg.in/warnings.v0"} at https://gopkg.in/warnings.v0?go-get=1
    gopkg.in/warnings.v0 (download)
    github.com/mitchellh/go-homedir (download)
    github.com/jbenet/go-context (download)
    Fetching https://golang.org/x/net/context?go-get=1
    Parsing meta tags from https://golang.org/x/net/context?go-get=1 (status code 200)
    get "golang.org/x/net/context": found meta tag get.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/context?go-get=1
    get "golang.org/x/net/context": verifying non-authoritative meta tag
    Fetching https://golang.org/x/net?go-get=1
    Parsing meta tags from https://golang.org/x/net?go-get=1 (status code 200)
    golang.org/x/net (download)
    github.com/emirpasic/gods (download)
    github.com/sergi/go-diff (download)
    Fetching https://golang.org/x/crypto/openpgp?go-get=1
    Parsing meta tags from https://golang.org/x/crypto/openpgp?go-get=1 (status code 200)
    get "golang.org/x/crypto/openpgp": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/openpgp?go-get=1
    get "golang.org/x/crypto/openpgp": verifying non-authoritative meta tag
    Fetching https://golang.org/x/crypto?go-get=1
    Parsing meta tags from https://golang.org/x/crypto?go-get=1 (status code 200)
    golang.org/x/crypto (download)
    github.com/kevinburke/ssh_config (download)
    github.com/xanzy/ssh-agent (download)
    Fetching https://golang.org/x/crypto/ssh?go-get=1
    Parsing meta tags from https://golang.org/x/crypto/ssh?go-get=1 (status code 200)
    get "golang.org/x/crypto/ssh": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ssh?go-get=1
    get "golang.org/x/crypto/ssh": verifying non-authoritative meta tag
    Fetching https://golang.org/x/crypto/ssh/knownhosts?go-get=1
    Parsing meta tags from https://golang.org/x/crypto/ssh/knownhosts?go-get=1 (status code 200)
    get "golang.org/x/crypto/ssh/knownhosts": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ssh/knownhosts?go-get=1
    get "golang.org/x/crypto/ssh/knownhosts": verifying non-authoritative meta tag
    Fetching https://golang.org/x/net/proxy?go-get=1
    Parsing meta tags from https://golang.org/x/net/proxy?go-get=1 (status code 200)
    get "golang.org/x/net/proxy": found meta tag get.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/proxy?go-get=1
    get "golang.org/x/net/proxy": verifying non-authoritative meta tag
    github.com/imdario/mergo (download)
    github.com/mattn/go-sqlite3 (download)
    github.com/gitsight/go-vcsurl (download)
    github.com/olekukonko/tablewriter (download)
    github.com/mattn/go-runewidth (download)
    github.com/spf13/cobra (download)
    github.com/spf13/pflag (download)
    ../go/src/github.com/go-git/go-git/remote.go:9:2: code in directory /home/simon/go/src/github.com/go-git/go-billy/osfs expects import "github.com/go-git/go-billy/v5/osfs"
    

    On investigation, https://github.com/go-git/go-billy/v5/osfs does not exist but https://github.com/go-git/go-billy/osfs does. Suggest this is bit-rot caused by the upstream package changing its directory structure?

    opened by simon-brooke 4
  • provide releases for non-Go developers

    provide releases for non-Go developers

    It would be nice to release this as a downloadable set of binaries. I have had some experience with GoReleaser and I have to say it's a pretty nice little tool, especially if you're working in Go. I'd prefer to be able to just brew install gitqlite, which GoReleaser has good support for: https://goreleaser.com/customization/homebrew/

    opened by klauern 4
  • fix panic when querying at the empty repository

    fix panic when querying at the empty repository

    This PR fixes panic when querying at the empty repository. This is my first Go language work :) I wish I could add a test, but after digging for a few hours, I gave up writing the test case :( Sorry for not adding a test case!

    master branch's behavior:

    $ mkdir empty-git
    $ cd empty-git
    $ git init
    Initialized empty Git repository in /home/youngminz/dist/empty-git-dir/.git/
    
    $ gitqlite "select * from commits"
    panic: invalid handle
            panic: invalid handle
    
    goroutine 1 [running]:
    github.com/mattn/go-sqlite3.lookupHandleVal(0x0, 0x0, 0x0, 0x0)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/callback.go:128 +0x13d
    github.com/mattn/go-sqlite3.lookupHandle(...)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/callback.go:135
    github.com/mattn/go-sqlite3.goVClose(0x0, 0x435a61)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/sqlite3_opt_vtable.go:448 +0x2f
    github.com/mattn/go-sqlite3._cgoexpwrap_7ec2bdc2f5b0_goVClose(0x0, 0x0)
            _cgo_gotypes.go:1506 +0x64
    github.com/mattn/go-sqlite3._Cfunc_sqlite3_finalize(0x29449d8, 0x0)
            _cgo_gotypes.go:962 +0x49
    github.com/mattn/go-sqlite3.(*SQLiteStmt).Close.func1(0xc0001227b0, 0x1)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/sqlite3.go:1767 +0x5f
    github.com/mattn/go-sqlite3.(*SQLiteStmt).Close(0xc0001227b0, 0x0, 0x0)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/sqlite3.go:1767 +0xac
    github.com/mattn/go-sqlite3.(*SQLiteRows).Close(0xc0000aaa20, 0x43520a, 0x7f44b710c6d0)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/sqlite3.go:1956 +0xa7
    database/sql.(*Rows).close.func1()
            /usr/lib/go-1.13/src/database/sql/sql.go:3076 +0x3c
    database/sql.withLock(0xc45a40, 0xc0000e8280, 0xc0000f3288)
            /usr/lib/go-1.13/src/database/sql/sql.go:3184 +0x6d
    database/sql.(*Rows).close(0xc0000e8300, 0x0, 0x0, 0x0, 0x0)
            /usr/lib/go-1.13/src/database/sql/sql.go:3075 +0x129
    database/sql.(*Rows).Close(0xc0000e8300, 0xc000124640, 0xc00009d8c0)
            /usr/lib/go-1.13/src/database/sql/sql.go:3059 +0x33
    panic(0xa7f040, 0xc31020)
            /usr/lib/go-1.13/src/runtime/panic.go:679 +0x1b2
    github.com/mattn/go-sqlite3.lookupHandleVal(0x0, 0x0, 0x0, 0x0)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/callback.go:128 +0x13d
    github.com/mattn/go-sqlite3.lookupHandle(...)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/callback.go:135
    github.com/mattn/go-sqlite3.goVFilter(0x0, 0x0, 0x2950630, 0x0, 0x29457e8, 0x2)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/sqlite3_opt_vtable.go:464 +0x40
    github.com/mattn/go-sqlite3._cgoexpwrap_7ec2bdc2f5b0_goVFilter(0x0, 0x0, 0x2950630, 0x0, 0x29457e8, 0x0)
            _cgo_gotypes.go:1535 +0x9e
    github.com/mattn/go-sqlite3._Cfunc__sqlite3_step_internal(0x29449d8, 0x0)
            _cgo_gotypes.go:414 +0x49
    github.com/mattn/go-sqlite3.(*SQLiteRows).nextSyncLocked.func1(0xc0000aaa20, 0xc00014a0c0)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/sqlite3.go:2030 +0x62
    github.com/mattn/go-sqlite3.(*SQLiteRows).nextSyncLocked(0xc0000aaa20, 0xc00013c1c0, 0xe, 0xe, 0xc00013c1c0, 0xe0)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/sqlite3.go:2030 +0x43
    github.com/mattn/go-sqlite3.(*SQLiteRows).Next(0xc0000aaa20, 0xc00013c1c0, 0xe, 0xe, 0x0, 0x0)
            /home/youngminz/go/pkg/mod/github.com/mattn/[email protected]+incompatible/sqlite3.go:2007 +0x2fb
    database/sql.(*Rows).nextLocked(0xc0000e8300, 0x430000)
            /usr/lib/go-1.13/src/database/sql/sql.go:2767 +0xd5
    database/sql.(*Rows).Next.func1()
            /usr/lib/go-1.13/src/database/sql/sql.go:2745 +0x3c
    database/sql.withLock(0xc47100, 0xc0000e8330, 0xc0000f3ad0)
            /usr/lib/go-1.13/src/database/sql/sql.go:3184 +0x6d
    database/sql.(*Rows).Next(0xc0000e8300, 0xc00013c000)
            /usr/lib/go-1.13/src/database/sql/sql.go:2744 +0x87
    github.com/augmentable-dev/gitqlite/cmd.tableDisplay(0xc0000e8300, 0x43520a, 0xc0000e8300)
            /home/youngminz/dist/gitqlite/cmd/root.go:233 +0x1ba
    github.com/augmentable-dev/gitqlite/cmd.displayDB(0xc0000e8300, 0x0, 0xc0000a4000)
            /home/youngminz/dist/gitqlite/cmd/root.go:136 +0x7d
    github.com/augmentable-dev/gitqlite/cmd.glob..func1(0x1031420, 0xc00010eaa0, 0x1, 0x1)
            /home/youngminz/dist/gitqlite/cmd/root.go:104 +0x2a6
    github.com/spf13/cobra.(*Command).execute(0x1031420, 0xc00009c030, 0x1, 0x1, 0x1031420, 0xc00009c030)
            /home/youngminz/go/pkg/mod/github.com/spf13/[email protected]/command.go:846 +0x2aa
    github.com/spf13/cobra.(*Command).ExecuteC(0x1031420, 0x0, 0x0, 0x0)
            /home/youngminz/go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x349
    github.com/spf13/cobra.(*Command).Execute(...)
            /home/youngminz/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
    github.com/augmentable-dev/gitqlite/cmd.Execute()
            /home/youngminz/dist/gitqlite/cmd/root.go:111 +0x2d
    main.main()
            /home/youngminz/dist/gitqlite/gitqlite.go:8 +0x20
    

    After my fix:

    $ gitqlite "select * from commits"
    repository is empty
    
    opened by youngminz 4
  • FEAT: improve git tables interface

    FEAT: improve git tables interface

    This pull-request improves the git virtual tables, building upon previous functionality and making following changes:

    • Make all git modules into table-valued functions [1] This switch allows us to support multi-repository queries.
    • Replace branches and tags with a unified refs table. See PRAGMA table_info(refs) for more info.
    • Drop the blame table
    • Add support for services.RepoLocator. Implementations of this interface could provide support for locating repositories at different locations while keeping the core agnostic of the fact where the repository lives.

    It also switches to go-git (away from libgit2) as the underlying git library provider. The switch is justified as go-git provides more Go-like access to git's data and is relatively more easier to extend. And being written in pure Go, it simplifies the build process.

    opened by riyaz-ali 3
  • fix(deps): update go.riyazali.net/sqlite digest to 0e640ca

    fix(deps): update go.riyazali.net/sqlite digest to 0e640ca

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | go.riyazali.net/sqlite | require | digest | bd9e30b -> 0e640ca |


    Configuration

    ๐Ÿ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • fix(deps): update module github.com/libgit2/git2go/v33 to v34

    fix(deps): update module github.com/libgit2/git2go/v33 to v34

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/libgit2/git2go/v33 | require | major | v33.0.9 -> v34.0.0 |


    Release Notes

    libgit2/git2go

    v34.0.0

    Compare Source

    This includes libgit2 v1.5


    Configuration

    ๐Ÿ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • fix(deps): update module github.com/dnaeon/go-vcr/v2 to v3

    fix(deps): update module github.com/dnaeon/go-vcr/v2 to v3

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/dnaeon/go-vcr/v2 | require | major | v2.0.1 -> v3.1.2 |


    Release Notes

    dnaeon/go-vcr

    v3.1.2

    Compare Source

    New field called DiscardOnSave has been added to the cassette.Interaction type, which allows for a hook to set it to true, and as a result to discard the interaction from saving it on disk.

    See #โ€‹80 for more details.

    v3.1.1

    Compare Source

    Cassettes with no recorded interactions will be saved on disk. Previous behaviour was to skip saving the cassette at all.

    See #โ€‹79

    v3.1.0

    Compare Source

    NOTE: This version contains breaking API change.

    Summary of changes since previous release.

    • The recorder.FilterFunc has been removed. It is now replaced by recorder.HookFunc type.
    • The Recorder.AddFilter() and Recorder.AddPreSaveFilter() methods have been removed. They are now replaced by the Recorder.AddHook() method.
    • Added different kinds of hooks supported by the recorder - AfterCaptureHook, BeforeSaveHook and BeforeResponseReplayHook.

    v3.0.1

    Compare Source

    Minor updates, adding two new utility methods to the recorder, which can be used to inspect the state of the recorder and the cassette.

    • IsRecording()
    • IsNewCassette()

    See https://github.com/dnaeon/go-vcr/pull/76

    v3.0.0

    Compare Source

    go-vcr v3 is ready.

    NOTE: This release is not backwards-compatible with previous versions of the cassettes used by go-vcr. If you are upgrading to v3 you should re-create your test cassettes.

    A summary of changes for this release:

    • API has been refactored and cleaned up
    • Custom recorder options are now specified as recorder.Options
    • The recorder modes which are now supported are ModeRecordOnly, ModeRecordOnce, ModeReplayOnly, ModeReplayWithNewEpisodes and ModePassthrough. Please refer to the API documentation for more details on their use cases
    • In order to create recorders with custom options you should use the recorder.NewWithOptions function from now on
    • The default mode of the recorder is now ModeRecordOnce
    • ModeDisabled has been removed and is now replaced by ModePassthrough
    • Cassette format has been changed and the supported version of the cassette from now on is v2.
    • Additional fields have been added to the cassette to allow developers to create more complex matchers based on the existing fields
    • Each interaction in the cassette now has a unique integer id, specifying the position of the interaction in the cassette
    • Utility method on the recorder can now return a pre-configured HTTP client with the recorder's transport - GetDefaultClient()
    • CI/CD pipeline has been transferred to Github actions
    • Closed out some long standing issues
    • Extended and refactored test cases
    • etc

    v2.3.0

    Compare Source

    • Cleaned up v2 package structure
    • Switched from gopkg.in/yaml.v2 to gopkg.in/yaml.v3. Closes #โ€‹70 and #โ€‹71
    • Package import path for go-vcr has changed from github.com/dnaeon/go-vcr to gopkg.in/dnaeon/go-vcr.v2. See #โ€‹73
    • v2 of go-vcr resides in the v2 branch, which is now the default
    • Fixed a regression where the default mode of the recorder has been changed. See #โ€‹72

    v2.1.0

    Compare Source

    Update to gopkg.in/yaml.v3


    Configuration

    ๐Ÿ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • fix(deps): update github.com/shurcool/githubv4 digest to a8d4a56

    fix(deps): update github.com/shurcool/githubv4 digest to a8d4a56

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/shurcooL/githubv4 | require | digest | 70889c5 -> a8d4a56 |


    Configuration

    ๐Ÿ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • fix(deps): update module golang.org/x/oauth2 to v0.2.0 - abandoned

    fix(deps): update module golang.org/x/oauth2 to v0.2.0 - abandoned

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | golang.org/x/oauth2 | require | minor | v0.1.0 -> v0.2.0 |


    Release Notes

    golang/oauth2

    v0.2.0

    Compare Source


    Configuration

    ๐Ÿ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 3
  • fix(deps): update module github.com/clbanning/mxj/v2 to v2.5.7 - abandoned

    fix(deps): update module github.com/clbanning/mxj/v2 to v2.5.7 - abandoned

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/clbanning/mxj/v2 | require | patch | v2.5.6 -> v2.5.7 |


    Release Notes

    clbanning/mxj

    v2.5.7: issue #โ€‹98

    Compare Source

    Recover issue #โ€‹38 patch.


    Configuration

    ๐Ÿ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 3
Releases(v0.5.10)
  • v0.5.10(Oct 11, 2022)

    What's Changed

    • chore: upgrade some dependencies by @patrickdevivo in https://github.com/mergestat/mergestat-lite/pull/303
    • Configure Renovate by @renovate in https://github.com/mergestat/mergestat-lite/pull/304
    • chore(deps): update codecov/codecov-action action to v3 by @renovate in https://github.com/mergestat/mergestat-lite/pull/308
    • chore(deps): update golang docker tag to v1.19 by @renovate in https://github.com/mergestat/mergestat-lite/pull/305
    • chore(deps): update actions/setup-go action to v3 by @renovate in https://github.com/mergestat/mergestat-lite/pull/311
    • chore(deps): update actions/checkout action to v3 by @renovate in https://github.com/mergestat/mergestat-lite/pull/310
    • fix: try adding gomodMassage to renovate config by @patrickdevivo in https://github.com/mergestat/mergestat-lite/pull/316
    • fix: clone sub modules when running renovate by @patrickdevivo in https://github.com/mergestat/mergestat-lite/pull/317
    • fix(deps): update go.riyazali.net/sqlite digest to df6a26c by @renovate in https://github.com/mergestat/mergestat-lite/pull/315
    • fix(deps): update module github.com/go-enry/go-enry/v2 to v2.8.3 by @renovate in https://github.com/mergestat/mergestat-lite/pull/313
    • fix(deps): update golang.org/x/oauth2 digest to b44042a by @renovate in https://github.com/mergestat/mergestat-lite/pull/314
    • chore(deps): update module go to 1.19 by @renovate in https://github.com/mergestat/mergestat-lite/pull/306

    New Contributors

    • @renovate made their first contribution in https://github.com/mergestat/mergestat-lite/pull/304

    Full Changelog: https://github.com/mergestat/mergestat-lite/compare/v0.5.9...v0.5.10

    Source code(tar.gz)
    Source code(zip)
    mergestat-linux-amd64.tar.gz(30.32 MB)
    mergestat-macos-amd64.tar.gz(29.90 MB)
  • v0.5.9(Oct 1, 2022)

    What's Changed

    • Fixed log messages for commits from comments to commits by @amenowanna in https://github.com/mergestat/mergestat-lite/pull/297
    • chore: rename repo to mergestat-lite by @patrickdevivo in https://github.com/mergestat/mergestat-lite/pull/301
    • chore: update some lint issues (deprecated std lib packages) by @patrickdevivo in https://github.com/mergestat/mergestat-lite/pull/302

    New Contributors

    • @amenowanna made their first contribution in https://github.com/mergestat/mergestat-lite/pull/297

    Full Changelog: https://github.com/mergestat/mergestat-lite/compare/v0.5.8...v0.5.9

    Source code(tar.gz)
    Source code(zip)
    mergestat-linux-amd64.tar.gz(29.58 MB)
    mergestat-macos-amd64.tar.gz(29.21 MB)
  • v0.5.8(Jun 30, 2022)

  • v0.5.7(Jun 21, 2022)

  • v0.5.6(Apr 23, 2022)

    What's Changed

    • feat: implement a "hook" for dealing with github API rate limit responses by @patrickdevivo in https://github.com/mergestat/mergestat/pull/270
    • fix: refactor github rate limit handler to be settable by @patrickdevivo in https://github.com/mergestat/mergestat/pull/271
    • feat: add hook for running a function before a GitHub API request by @patrickdevivo in https://github.com/mergestat/mergestat/pull/272
    • feat: add GitHub post request hook by @patrickdevivo in https://github.com/mergestat/mergestat/pull/273
    • fix: implement WithGitHubPostRequestHook by @patrickdevivo in https://github.com/mergestat/mergestat/pull/274
    • chore: update dependencies, including sqlite by @patrickdevivo in https://github.com/mergestat/mergestat/pull/278
    • feat: add table-valued-function for listing GitHub PR reviews by @patrickdevivo in https://github.com/mergestat/mergestat/pull/279
    • fix: use a sync.Map instead of a plain map in the CachedLocator by @patrickdevivo in https://github.com/mergestat/mergestat/pull/281
    • feat: add id column to github_pr_reviews table by @patrickdevivo in https://github.com/mergestat/mergestat/pull/283
    • fix: proper types for some columns on github_pr_reviews table by @patrickdevivo in https://github.com/mergestat/mergestat/pull/284
    • chore: upgrade libgit2 by @patrickdevivo in https://github.com/mergestat/mergestat/pull/287
    • fix: add constraints for github_repo_prs table by @patrickdevivo in https://github.com/mergestat/mergestat/pull/288

    Full Changelog: https://github.com/mergestat/mergestat/compare/v0.5.5...v0.5.6

    Source code(tar.gz)
    Source code(zip)
    mergestat-linux-amd64.tar.gz(29.56 MB)
    mergestat-macos-amd64.tar.gz(29.19 MB)
  • v0.5.5(Mar 8, 2022)

    Notable Changes

    • Upgraded to SQLite 2.38.0, which supports new JSON operators -> and ->> ๐ŸŽ‰
    • Added csv-noheader and tsv-noheader output formats for excluding CSV/TSV headers ๐Ÿ“‹
    • New time formatting utility functions time_diff and approx_dur ๐Ÿ•
    • New github_repo scalar function for retrieving GitHub repo info as JSON โ„น๏ธ

    Overall Changes

    • fix: address issue with mailmap parsing not occurring by @patrickdevivo in https://github.com/mergestat/mergestat/pull/255
    • fix: rename scalar funs to time_diff and approx_dur by @patrickdevivo in https://github.com/mergestat/mergestat/pull/262
    • feat: time formatting sqlite print functions by @Vialeon in https://github.com/mergestat/mergestat/pull/261
    • feat: implement github_repo scalar function by @patrickdevivo in https://github.com/mergestat/mergestat/pull/263
    • feat: upgrade sqlite to 2.38.0 (and other go deps as well) by @patrickdevivo in https://github.com/mergestat/mergestat/pull/264
    • feat: add some screenshots to the README by @patrickdevivo in https://github.com/mergestat/mergestat/pull/265
    • feat: implement csv-noheader and tsv-noheader output formats by @patrickdevivo in https://github.com/mergestat/mergestat/pull/267
    • feat: vendor libgit2 (via git2go) by @patrickdevivo in https://github.com/mergestat/mergestat/pull/266

    Full Changelog: https://github.com/mergestat/mergestat/compare/v0.5.4...v0.5.5

    Source code(tar.gz)
    Source code(zip)
    mergestat-linux-amd64.tar.gz(29.50 MB)
    mergestat-macos-amd64.tar.gz(29.14 MB)
  • v0.5.4(Feb 16, 2022)

    Screen Shot 2022-02-15 at 3 40 12 PM

    What's Changed

    • feat: refactor summary command, rename to summarize by @patrickdevivo in https://github.com/mergestat/mergestat/pull/249
    • feat: implement .mailmap parsing by @patrickdevivo in https://github.com/mergestat/mergestat/pull/250
    • fix: add short description to summary command by @patrickdevivo in https://github.com/mergestat/mergestat/pull/251
    • fix: don't show "more" footer when there's no limit provided by @patrickdevivo in https://github.com/mergestat/mergestat/pull/252
    • fix: error handling for summarize commands by @patrickdevivo in https://github.com/mergestat/mergestat/pull/253

    Full Changelog: https://github.com/mergestat/mergestat/compare/v0.5.3...v0.5.4

    Source code(tar.gz)
    Source code(zip)
    mergestat-linux-amd64.tar.gz(27.11 MB)
    mergestat-macos-amd64.tar.gz(27.68 MB)
  • v0.5.3(Feb 2, 2022)

    What's Changed

    • feat: allow specifying a sqlite db to mount, add --append mode to export command by @patrickdevivo in https://github.com/mergestat/mergestat/pull/244
    • feat: add date filtering and --json output to the summary sub command by @patrickdevivo in https://github.com/mergestat/mergestat/pull/245
    • feat: implement blame subcommand to show summary of blame info by @patrickdevivo in https://github.com/mergestat/mergestat/pull/246
    • feat: add support for GIT_SSL_NO_VERIFY when cloning repos by @patrickdevivo in https://github.com/mergestat/mergestat/pull/247

    mergestat summary --start "-30 days"

    summary-demo

    mergestat blame

    blame-demo

    Full Changelog: https://github.com/mergestat/mergestat/compare/v0.5.2...v0.5.3

    Source code(tar.gz)
    Source code(zip)
    mergestat-linux-amd64.tar.gz(27.10 MB)
    mergestat-macos-amd64.tar.gz(27.68 MB)
  • v0.5.2(Jan 26, 2022)

  • v0.5.1(Jan 22, 2022)

    • SQLite upgraded v3.35.0 โžก๏ธ v3.37.0
    • ---clone-dir flag (and clone func) added, now trivial to clone all repos in an org (or any set of repositories from GitHub) โฌ‡๏ธ
    • Implement service mode, run an HTTP API server that executes queries and responds with JSON results ๐ŸŒ
    • Add summary command for printing out a commit and author summary for the default repo ๐Ÿ“Š
    • New GitHub tables: github_repo_branches, github_repo_pr_commits and github_repo_commits ๐ŸŽ‰
    • Rename prior json output mode behavior to ndjson, and add a json output ๐Ÿ‘ฉโ€๐Ÿ’ป
    • Allow GITHUB_TOKEN to be used when cloning https repos ๐Ÿ”

    Example of mergestat summary

    image

    Source code(tar.gz)
    Source code(zip)
    mergestat-linux-amd64.tar.gz(26.89 MB)
    mergestat-macos-amd64.tar.gz(27.44 MB)
  • v0.4.9(Oct 15, 2021)

  • v0.4.8(Oct 13, 2021)

  • v0.4.7(Sep 25, 2021)

    • Add a github_repo_branch_protections GitHub API table ๐Ÿ”’
    • Add an npm_get_package NPM Registry API helper function
    • Add logging functionality via a -v or --verbose flag to show what a query is doing "under the hood" ๐ŸŽ‰
    • Errors also use the new logger
    • Upgrade libgit2 dependency to v.1.2.x โฌ†๏ธ
    • Add affiliations as a param to github_user_repos and github_org_repos tables
    • Add an SSH repo locator (ssh:// repos will now work)
    Source code(tar.gz)
    Source code(zip)
    askgit-linux-amd64.tar.gz(26.63 MB)
    askgit-macos-amd64.tar.gz(27.95 MB)
  • v0.4.6(Aug 21, 2021)

  • v0.4.5(Aug 12, 2021)

  • v0.4.4(Aug 12, 2021)

  • v0.4.2(Aug 4, 2021)

  • v0.4.1(Jul 27, 2021)

  • v0.4.0(Jul 20, 2021)

    Major rearchitecting/rewrite of the internal structure and implementation of the codebase. Includes schema changes (see the README) and implements all git tables as table-valued-functions (that can receive parameters, i.e. SELECT * FROM commits('', 'HEAD~5'). Multi-repo queries are now supported ๐ŸŽ‰

    Source code(tar.gz)
    Source code(zip)
  • v0.3.7(Jan 18, 2021)

  • v0.3.1(Dec 13, 2020)

  • v0.3.0(Nov 16, 2020)

  • v0.2.1(Oct 8, 2020)

  • v0.2.0(Sep 12, 2020)

  • v0.0.1(Jul 3, 2020)

A better way to clone, organize and manage multiple git repositories

git-get git-get is a better way to clone, organize and manage multiple git repositories. git-get Description Installation macOS Linux Windows Usage gi

Greg Dlugoszewski 64 Nov 16, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Maxar Infrastructure 1 Feb 5, 2022
๐Ÿ’Š A git query language

Gitql Gitql is a Git query language. In a repository path... See more here Reading the code โš ๏ธ This project was created in 2014 as my first go project

Claudson Oliveira 6.1k Dec 29, 2022
A CLI to replace your git commit command, so your git message can partially follow the Conventional Changelog ecosystem

COMMIT CLI A CLI to replace your git commit command, so your git message can partially follow the Conventional Changelog ecosystem. And yes, it is bui

Hisam Fahri 1 Feb 9, 2022
git-glimpse is a command-line tool that is aimed at generating a git prompt like the one from zsh-vcs-prompt.

Git GoGlimpse git-glimpse is a command-line tool that is aimed at generating a git prompt like the one from zsh-vcs-prompt. The particularity of this

Corentin de Boisset 0 Jan 27, 2022
Go Coverage in Shell: a tool for exploring Go Coverage reports from the command line

Go Coverage in Shell: a tool for exploring Go Coverage reports from the command line

Yury Fedorov 263 Dec 31, 2022
cross-platform, cli app to perform various operations on string

sttr is command line software that allows you to quickly run various transformation operations on the string.

Abhimanyu Sharma 632 Dec 30, 2022
Tnbassist - A CLI tool for thenewboston blockchain to perform various mundane tasks like taking daily accounts backup

TNB Assist is a CLI (Command Line Interface) tool for thenewboston blockchain to perform various mundane tasks like taking daily accounts backup, computing statistics, etc easier.

Open blockchain explorer 1 Feb 14, 2022
Architecture checks for Go projects

Arch-Go Architecture checks for Go projects Supported rules Dependencies Checks Supports defining import rules Allowed dependencies Not allowed depend

Francisco Daines 85 Dec 20, 2022
A simple go program which checks if your websites are running and runs forever (stop it with ctrl+c). It takes two optional arguments, comma separated string with urls and an interval.

uptime A simple go program which checks if your websites are running and runs forever (stop it with ctrl+c). It takes two optional arguments: -interva

Markus Tenghamn 12 Dec 15, 2022
๐Ÿซ A customisable, universally compatible terminal status bar

Shox: Terminal Status Bar A customisable terminal status bar with universal shell/terminal compatibility. Currently works on Mac/Linux. Installation N

Liam Galvin 679 Dec 27, 2022
A set of Go scripts to monitor YAGPDB status via the command-line.

A set of Go scripts to monitor YAGPDB status by making GET requests to the YAGPDB status endpoint.

Joe 2 Apr 20, 2022
A simple visualization from the terminal of tintin++ bot status.

Kalterm A simple visualization from the terminal of tintin++ bot status. It uses kalterm.tin (in the tintin directory) to create a #port session on 95

Tom Allen 2 Oct 27, 2022
Battery - cross-platform get battery status

battery Cross-platform get battery status. Tested on Arch Linux, Debian, Ubuntu, Windows, macOS. import "github.com/caiguanhao/battery" battery.GetSt

CGH 0 Dec 31, 2021
Dwmstatus - Simple modular dwm status thing made in go

dwm status simple modular dwm status command made in go that has drop in plugins

null 5 Oct 31, 2022
:zap: boilerplate template manager that generates files or directories from template repositories

Boilr Are you doing the same steps over and over again every time you start a new programming project? Boilr is here to help you create projects from

Tamer Tas 1.5k Jan 6, 2023
CLI tool for manipulating GitHub Labels across multiple repositories

takolabel Installation Mac $ brew install tommy6073/tap/takolabel Other platforms Download from Releases page in this repository. Usage Set variables

Takayuki NAGATOMI 10 Nov 3, 2022
Grab is a tool that downloads source code repositories into a convenient directory layout created from the repo's URL's domain and path

Grab is a tool that downloads source code repositories into a convenient directory layout created from the repo's URL's domain and path. It supports Git, Mercurial (hg), Subversion, and Bazaar repositories.

Jeff Hodges 19 Jun 2, 2022
Go terminal app listing open pull requests in chosen GitHub repositories

go-pr-watcher About Shows open pull requests on configured GitHub repositories. Getting started Create GitHub personal token with read permissions Cre

Oleg 1 Aug 23, 2022