whateverable icon indicating copy to clipboard operation
whateverable copied to clipboard

git ls-files (“treegrep:”)

Open AlexDaniel opened this issue 7 years ago • 3 comments

<Zoffix> AlexDaniel: feature request: ability to find to which distro a filename belongs too; aka tree -f | grep XXX :)

In other words: grepping by filename.

This is actually relatively easy. We can use git ls-files -z to get the list of all files, then grep that with a 6lang regex similarly to how Quotable does it right now. There are about 17888 lines to grep through, and this is nothing. Quotable and Unicodable grep over millions of lines with 6lang regexes without any issues.

The only problem is that currently greppable is using perl5 regexes, so it is counter-intuitive to implement another command that does something different. Which kinda suggests that we may want to switch the whole thing to use 6lang regexes…

AlexDaniel avatar Aug 17 '17 21:08 AlexDaniel

Quick prototype:

<AlexDaniel> treegrep: hello <greppable6> AlexDaniel, https://gist.github.com/a0f31a8418beb7c128cf21ea1030591d

  • [ ] Surely these have to be links, but that's for another day.

AlexDaniel avatar Aug 18 '17 03:08 AlexDaniel

  • [ ] Also, it currently gists “Found nothing”.

  • [ ] And it needs to have 50 files matched: https://… inline summary.

AlexDaniel avatar Jan 31 '18 11:01 AlexDaniel

I was assigned here because I was actively working on it. Now the experimental version is committed, so anyone should feel free to work on it.

AlexDaniel avatar Mar 28 '18 08:03 AlexDaniel