{"id":6438,"date":"2017-07-19T11:51:00","date_gmt":"2017-07-19T15:51:00","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=6438"},"modified":"2017-07-19T11:51:16","modified_gmt":"2017-07-19T15:51:16","slug":"video-on-counsel-git-grep","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=6438","title":{"rendered":"Video on <code>counsel-git-grep<\/code>"},"content":{"rendered":"<p> After rewatching <a href=\"http:\/\/irreal.org\/blog\/?p=6424\">abo-abo&rsquo;s refactoring video<\/a> I decided check out his other videos. I&rsquo;ve seen most of them, of course, but mostly forgotten the details. One video, <a href=\"https:\/\/www.youtube.com\/watch?v=AgRsYOJi6ao\">counsel git grep demo<\/a>, is really informative and worth your time. <\/p>\n<p> If you have the Ivy\/Counsel\/Swiper suite installed, you already have <code>counsel-git-grep<\/code>. It&rsquo;s a really handy way of grepping through a git repository. That may sound a bit limited but it&rsquo;s not. What it does is grep through all the files in the current git repository where &ldquo;current git repository&rdquo; means the repository that has a <code>.git<\/code> directory in the current directory hierarchy. It works by calling <code>git grep<\/code> so in a sense it&rsquo;s nothing new but it&rsquo;s really handy to be able to invoke from within Emacs without having to shell out. All the results are put in the minibuffer in the usual Ivy way so it&rsquo;s easy to find the right match or to put the results in a separate buffer by calling <code>ivy-occur<\/code> and deal with the matches one-by-one or even en masse as described in the refactoring video. <\/p>\n<p> After watching the video, I added bindings for <code>counsel-git-grep<\/code> to my configuration so that I can call it easily. The video is only 4 minutes so you can watch it twice while the coffee&rsquo;s brewing. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>After rewatching abo-abo&rsquo;s refactoring video I decided check out his other videos. I&rsquo;ve seen most of them, of course, but mostly forgotten the details. One video, counsel git grep demo, is really informative and worth your time. If you have &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=6438\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-6438","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6438"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6438\/revisions"}],"predecessor-version":[{"id":6439,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6438\/revisions\/6439"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}