Monday, July 4, 2016

TIP: Git Grep searches your project really fast

Searching inside a large project of source code can be a challenge

In my codebase there's lots of "delete" methods, but only a few "_delete_" methods. If I search for "delete", I'll get zillions of false positives. By using the super-fast Git Grep and also "\W" for matching non-word-characters, I can find all references of the target string "_delete_":

$ git grep '\W_delete_\W'
app/looks_services.py:390:        order._delete_()
app/models.py:2634:    def _delete_(self, **kwargs):

No comments:

Post a Comment