But why does it have to look like SQL (and not like xpath or jquery)? Not many people enjoy writing SQL statements on the command line. It's verbose, the order of things is arbitrary...
I would assume that the whole point of the project is to be able to do SQLish queries on a git repo, and that it was written by and for people who are familiar with SQL and have a preference for it over other query languages. And they probably do enjoy writing SQL statements on the command line, however uncommon that may or may not be.
A Git query language
61–70 of 72 posts
Re: A Git query language
#62Earlier quoted context omitted.
I would assume that the whole point of the project is to be able to do SQLish queries on a git repo, and that it was written by and for people who are familiar with SQL and have a preference for it over other query languages. And they probably do enjoy writing SQL statements on the command line, however uncommon that may or may not be.
Seems to be very narrow group. How is this relevant to HN? Flagged the story.
Re: A Git query language
#63Earlier quoted context omitted.
Seems to be very narrow group. How is this relevant to HN? Flagged the story.
You flagged the story because you don't like SQL on the CLI? Come on. Whether or not you enjoy writing SQL on the CLI, SQL is a fine language for querying data, and is probably more common than xpath. JQuery seems like a strange choice too.
Re: A Git query language
#64Earlier quoted context omitted.
Git map would work for many cases https://github.com/icefox/git-map Git map ql ...
Thank you for suggesting git-map. I tried it and intend to include it into my workflow. I thought your suggestion was a good one so I tested it. It did not work for me due to: "dyld: Library not loaded: libgit2.21.dylib". I assume this is something about my setup (mac, zsh, other stuff) but if you got this working I'd like to know so I can keep trying my with my setup. To clarify: both git-map and gitql work for me,…
Re: A Git query language
#65Earlier quoted context omitted.
Git map would work for many cases https://github.com/icefox/git-map Git map ql ...
Nice. I can see a need for this as a lot of my projects are structured like that (multiple sibling repos). Running 'git map log --grep ...' seems particularly useful. 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...
Re: A Git query language
#66Oh 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.
Just for comparison, in Mercurial you would do hg log --template "{author}, {desc}\n" --rev "desc('fuck')"
Re: A Git query language
#67Re: A Git query language
#68Earlier quoted context omitted.
I would assume that the whole point of the project is to be able to do SQLish queries on a git repo, and that it was written by and for people who are familiar with SQL and have a preference for it over other query languages. And they probably do enjoy writing SQL statements on the command line, however uncommon that may or may not be.
Seems to be very narrow group. How is this relevant to HN? Flagged the story.
Re: A Git query language
#69Earlier quoted context omitted.
My thoughts went straight to PostgreSQL Foreign Data Wrappers. Something like that would be really helpful!
Wouldn't that require a running Postgres server, though? Seems a bit heavy for ad hoc queries. For something like a GitLab server, though, that would be amazing.
Re: A Git query language
#70Earlier quoted context omitted.
Revsets are a wonderful feature, and it's something I wish git had. Just being able to say I want to see what has changed between this branch head and its latest common ancestor with trunk is an incredibly simple and useful thing to be able to do.
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...
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.