5 ms·
You could add them to .rgignore or .ignore (which also works with ag, IIRC) instead of adding them to .gitignore.
by woadwarrior01 6y ago
You could add them to .rgignore or .ignore (which also works with ag, IIRC) instead of adding them to .gitignore.
- oefrha 6y agoWhich is again impossible when you use someone else’s web frontend for code search. Plus if you’re editing .rgignore on the filesystem for every search, what’s the point of using a web frontend?
- the_mitsuhiko 6y agoNot sure why ignore files are not the solution here. You can check on an ignore file into your repo then whoever uses ripgrep through whatever fronend gets that logic applied. I’m using this and i don’t quite see the downsides of that.
- oefrha 6y ago- I can’t control what someone else checks into their repo. I use web frontends for code search almost exclusively on other people’s repos, because my own repos are already on my machine, so what’s the point. - Most of the time I don’t want to see search results in tests, but occasionally I actually want to find things in tests and not anywhere else. Different people have different filtering needs at different times, you can’t have a ignore file that satisfies every need. Search is about filtering to begin with.
- the_mitsuhiko 6y agoDatasette is a tool you run against your stuff usually. I have control over my repos. Once you do cross repos search providing global filters on every query turns into an awful user experience. WRT web frontends: datasette runs locally.
- oefrha 6y agoWell, all this tool does is calling rg from a directory with a bunch of repos, so providing global filters on every query is as awful as rg providing a --glob flag... Which is arguably not that awful to a lot of users. > Datasette is a tool you run against your stuff usually. ... datasette runs locally. I don't think so? I could be wrong but I thought a major use case (or the major use case) is providing a frontend for your data to other people. Like on https://ripgrep.datasette.io/-/ripgrep https://ripgrep.datasette.io/-/ripgrep. To quote https://docs.datasette.io/en/stable/ https://docs.datasette.io/en/stable/, > Datasette is aimed at data journalists, museum curators, archivists, local governments and anyone else who has data that they wish to share with the world.
- the_mitsuhiko 6y ago> I don't think so? I could be wrong but I thought a major use case (or the major use case) is providing a frontend for your data to other people. _I_ use datasette and I only ever used it locally or in a docker container. In either case for datasette-ripgrep to work you need to check out the repos you want to search in one folder that datasette will then invoke ripgrep on. There are folks that publish datasette installations for public consumptions but even in that case I would assume that code search was preconfigured to make any sense with ignore files.
- masklinn 6y ago> To quote https://docs.datasette.io/en/stable/ https://docs.datasette.io/en/stable/, >> Datasette is aimed at data journalists, museum curators, archivists, local governments and anyone else who has data that they wish to share with the world. That doesn't preclude installing the program locally. The official "getting started" talks of remote / web datasettes as "demos" and "trials".
- oefrha 6y ago> That doesn't preclude installing the program locally. Of course not. But the project makes it pretty clear that it's designed with multiuser in mind. Can you host multiuser web apps only for yourself? Of course, I do that all the time. The unreasonable thing is saying "I use this thing exclusively for my own stuff on my local network, so screw your requests for multiuser, public-facing use cases."
- TeMPOraL 6y agoLet's flip this around: why would that make sense? Filtering expressions belong to a query, not configuration. Having to use ignore files for this is like not being allowed to use the WHERE clause in SQL, and having to rely on .sqlwhere config file instead.
- the_mitsuhiko 6y agoBecause I ripgrep all the time and don’t want to configure it every time I query.
- colejohnson66 6y agoThat’s great that it works for you, but it doesn’t work for me. What about the one-off search of someone else’s code? I don’t want to check out the repo just to add/edit a file so I can run ripgrep locally. If GitHub has a search feature that is entirely online, it would make sense for people to request they improve it.
- the_mitsuhiko 6y agoThe topic is datasette and ripgrep. I would be curious why in the context of those tools ignore files are not a solution. I agree that github codesearch leaves a lot to be desired.
- OJFord 6y agoPut it this way, OP is basically a web interface for ripgrep; ripgrep supports not just 'automatic' filtering through ignore files, but also 'manual' filtering per-query through the -g flag. OP should have an interface to the -g flag.
- the_mitsuhiko 6y agoI agree that a -g flag would be useful. However given the original comment and how datasette is used I figured the ignore file would be a good solution.
- deleted 6y ago[deleted]