Earlier quoted context omitted.
I believe the goal is to get a diff, not a list of commits, in which case you need to figure out an expression for getting the last commit common to master and experiment so you can diff it with experiment.
`git diff master..experiment`
A Git query language
41–50 of 72 posts
Re: A Git query language
#42Oh I love that the example gif includes: 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')"Re: A Git query language
#43Earlier quoted context omitted.
Complete guess based on [1], but wouldn't git diff HEAD $(git merge-base HEAD master) work? [1]: https://stackoverflow.com/questions/1549146/find-common-ance...
This requires using bash. I find it kind of cheating that git ships bash on Windows so that Windows users can rely on bash for composing git commands. I'm not sure if Windows users are generally that happy about typing bash commands, but I guess nobody really cares what you have to type in as long as it's high in the Google hits for whatever operation you want to perform. Mercurial's API (i.e. the CLI) makes a point…
Re: A Git query language
#44Earlier quoted context omitted.
Complete guess based on [1], but wouldn't git diff HEAD $(git merge-base HEAD master) work? [1]: https://stackoverflow.com/questions/1549146/find-common-ance...
This requires using bash. I find it kind of cheating that git ships bash on Windows so that Windows users can rely on bash for composing git commands. I'm not sure if Windows users are generally that happy about typing bash commands, but I guess nobody really cares what you have to type in as long as it's high in the Google hits for whatever operation you want to perform. Mercurial's API (i.e. the CLI) makes a point…
Re: A Git query language
#45 git log --pretty="format:%an, %s, %ad" --after="2014-04-10" | grep "Fuck" | head -3Re: A Git query language
#46This might benefit from SQLite's Virtual tables: https://sqlite.org/vtab.html 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 art…
My thoughts went straight to PostgreSQL Foreign Data Wrappers. Something like that would be really helpful!
For something like a GitLab server, though, that would be amazing.
Re: A Git query language
#47Re: A Git query language
#48Earlier quoted context omitted.
`git diff master..experiment`
I just tried that, and it seems to be the same as `git diff master experiment`. We don't want to diff the two heads. The command in Mercurial is `hg diff -r 'ancestor(master, experiment)' -r experiment`. Comrade trolor seems to have found the correct git expression.
git diff master...experiment
(note there's three periods)Re: A Git query language
#49Imagine if we could just have this automatically for every program that generated text output. It doesn't seem beyond the realms of possibility that every tool could either a) structure its text output in a way that can guarantee simple command-piping to a general purpose query-language processing tool or b) in the presence of a "--output-json" flag, produce json which can then easily be queried.
Also, if you work with CSV files, look at textql.
Re: A Git query language
#50Earlier quoted context omitted.
https://github.com/gitql/gitql (last commit 12 days ago)
Not the same project (look at the number of commits, and the top issue).
> 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.