A Git query language
github.com
github.com
With Virtual Tables you can expose any data source as a SQLite table -- then you can use every SQL feature that sqlite offers. You can just tell sqlite how to iterate through your data with a few functions, with an option to push down filtering information for efficiency.
You can also create your own aggregates, functions etc.
Here's an article where the author exposes redis as a table within sqlite: http://charlesleifer.com/blog/extending-sqlite-with-python/
For something like a GitLab server, though, that would be amazing.
A very cursory search suggests no one has built this yet.
Minor off topic rant about the animated example: Who doesn't put a space at the end of their prompt after the $?! Ugh!
https://github.com/icefox/git-map
Git map ql ...Quick eyeballing of the source, it does not handle whitespace in directory names properly. The for loop would treat them as separate, invalid, entries.
Of course I'd also fire someone on the spot that commits a project directory with whitespace in it...
accompanying blog post: https://syslog.ravelin.com/multi-to-mono-repository-c81d004d...
Bit of a hack, but could come in handy for other things (off the top of my head: "welcome to the team! Clone this one thing, it contains everything you need.").
I have a big "projects" folder with lots of different repos. I'd like to know all commits I've made on the past month, across all projects.
Currently I have a post-commit hook which sends the one line shortlog to a common file, but would be nicer to have a tool for ad-hoc queries.
I've always had mixed feelings about that. Resolved it now, by using '>', no space, which doesn't look cluttered since there's only ~1px right next to the first char entered.
https://github.com/gitql/gitql/issues/83
"The relation is its purpose: SQL + Git, written in Go. There is no relation other than that."
I thought this might help anyone else who was similarly interested.
I was actually hoping that gitql had finally gotten inspiration from Mercurial and git would grow a general purpose query language, but it's read-only. :-(
git diff HEAD $(git merge-base HEAD master)
work?[1]: https://stackoverflow.com/questions/1549146/find-common-ance...
Mercurial's API (i.e. the CLI) makes a point of being usable with powershell and cmd.exe, which I think some Windows users appreciate.
Diff would be `hg diff -r 'ancestor(default, experiment)' -r experiment`
Want to list commits in experiment? Just change diff to log. Generate patch file with all commits? Change it to export.
git diff master...experiment
(note there's three periods)I'm kind of confused because gitrevisions(7) says the triple dot is symmetric difference, but exchanging master and experiment does not produce the same output from diff.
A Git query language (github.com)
10 points by bryanrasmussen 1 hour ago
This ought to have (2014) in the title: Latest commit 49c1c17 on 22 Jun 2014.> interesting, I mean the fact that this _or something similar_ didn't get traction
I think you'll agree this is something very similar and that has traction.
The syntax seems close enough that this could just replace it, though:
ls commits | where date < (get-date).AddDays(-4) | where message -like *foo* | select autor, message, date -First 3 | ft select author, message
from commits
where 'Fuck' in message
I'm pretty sure that query's results would fill my screen buffer. hg log --template "{author}, {desc}\n" --rev "desc('fuck')"Also, if you work with CSV files, look at textql.
git log --pretty="format:%an, %s, %ad" --after="2014-04-10" | grep "Fuck" | head -3Not many people enjoy writing SQL statements on the command line. It's verbose, the order of things is arbitrary...