Live data from Hacker News

A Git query language

github.com

21–30 of 72 posts

Re: A Git query language

#21
post #17
post #4

This is pretty cool. Looks like it's local to the current repo which makes sense for most usage. Having something like this across a swathe of repos would be useful in different ways (ex: " What has Bob committed over all the repos for our projects that involves the string 'billing'? ". Minor off topic rant about the animated example: Who doesn't put a space at the end of their prompt after the $?! Ugh!

I agree. Since we work with microservices, we have +10 repo per project. Would be nice to be able to scan through all of them.

You could submodule them all in an otherwise empty parent repo.

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.").

Re: A Git query language

#23
post #18
post #4

This is pretty cool. Looks like it's local to the current repo which makes sense for most usage. Having something like this across a swathe of repos would be useful in different ways (ex: " What has Bob committed over all the repos for our projects that involves the string 'billing'? ". Minor off topic rant about the animated example: Who doesn't put a space at the end of their prompt after the $?! Ugh!

Git map would work for many cases https://github.com/icefox/git-map Git map ql ...

Something seemingly related is Myrepos [1], for doing stuff like "update all these repos". Probably more capable, and complicated to use.

It's also "vcs agnostic".

[1]: https://myrepos.branchable.com/

Re: A Git query language

#24
post #9

Imagine 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.

Or you could have a single address space ( https://en.wikipedia.org/wiki/Single_address_space_operating... ), and share objects directly.

Sounds like a security nightmare.

Re: A Git query language

#25
post #24
post #9

Earlier quoted context omitted.

Or you could have a single address space ( https://en.wikipedia.org/wiki/Single_address_space_operating... ), and share objects directly.

Sounds like a security nightmare.

But is it really? Couldn't there be a way to isolate things at the system level?

Re: A Git query language

#26
post #13

Earlier quoted context omitted.

Mercurial's are completely general, though. Any Mercurial command that can accept a revision as an argument can also accept a revset expression. And templating isn't just for log, but for many other commands, such as grep or annotate (blame), and it's the same templating language for all of them. I also find hg templates a bit easier to read, because they're Djangoish/Jinjaish instead of being printf-ish like git's.…

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...

Re: A Git query language

#27
post #12
post #5

Earlier quoted context omitted.

That makes it even more interesting, I mean the fact that this or something similar didn't get traction. I often have an idea of what I would like to know about my repo, but don't want to start hacking the answer together.

https://github.com/gitql/gitql (last commit 12 days ago)

Not the same project (look at the number of commits, and the top issue).

Re: A Git query language

#28
post #17
post #4

This is pretty cool. Looks like it's local to the current repo which makes sense for most usage. Having something like this across a swathe of repos would be useful in different ways (ex: " What has Bob committed over all the repos for our projects that involves the string 'billing'? ". Minor off topic rant about the animated example: Who doesn't put a space at the end of their prompt after the $?! Ugh!

I agree. Since we work with microservices, we have +10 repo per project. Would be nice to be able to scan through all of them.

Plug: if you ever find yourself wanting to merge everything painlessly: https://github.com/unravelin/tomono :)

accompanying blog post: https://syslog.ravelin.com/multi-to-mono-repository-c81d004d...

Re: A Git query language

#30
post #4

This is pretty cool. Looks like it's local to the current repo which makes sense for most usage. Having something like this across a swathe of repos would be useful in different ways (ex: " What has Bob committed over all the repos for our projects that involves the string 'billing'? ". Minor off topic rant about the animated example: Who doesn't put a space at the end of their prompt after the $?! Ugh!

Seconded on a multirepo tool for that.

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.

Post reply on HN