<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>ripgrep &amp;mdash; Nat Knight</title>
    <link>http://natknight.xyz/tag:ripgrep</link>
    <description>Reflections, diversions, and opinions from a progressive ex-physicist programmer dad with a sore back.</description>
    <pubDate>Sun, 24 May 2026 14:17:29 -0700</pubDate>
    <item>
      <title>A foot gun in ripgrep</title>
      <link>http://natknight.xyz/a-foot-gun-in-ripgrep</link>
      <description>&lt;![CDATA[#ripgrep #tool #footgun&#xA;&#xA;I adore ripgrep. It&#39;s fast, it&#39;s convenient, and I&#39;ve never wanted a feature and found it missing.&#xA;&#xA;But no software is perfect, and today ripgrep was the program causing problems.&#xA;&#xA;div style=&#34;border-radius: 1em; background: aliceblue; padding: 1em; border: 1px solid blue;&#34;&#xA;h2Update/h2&#xA;pAndrew Gallant (the author of RipGrep) a href=&#34;https://bsky.app/profile/burntsushi.net/post/3lvt7jzqejc2v&#34;kindly pointed out on BlueSky/a that you can also address this by running a command in your repo:/p&#xA;&#xA;precodeecho &#39;!/.github/&#39;     .rgignore/code/pre&#xA;&#xA;pThanks Andrew!/p&#xA;/div&#xA;!--more--&#xA;&#xA;By default, ripgrep doesn&#39;t search everything. It checks your .gitignore for example, which is wonderful when you don&#39;t want to be searching all of nodemodules. It also ignores hidden files and that&#39;s what bit me today.&#xA;&#xA;See GitHub Actions are stored under .github/workflows/, so when I removed a particular file and rg&#39;d through my whole codebase making sure it wasn&#39;t used anywhere I missed that it was used in some GitHub Actions.&#xA;&#xA;Easily fixed, but how to make sure I don&#39;t get bit again?&#xA;&#xA;We can search hidden files (but ignore .git/) with&#xA;&#xA;rg --hidden --glob=!.git/&#xA;&#xA;but that&#39;s a bit of a pain to type for a tool I use many times daily.&#xA;&#xA;It turns out ripgrep does have a configuration file that you can activate by setting an environment variable (RIPGREPCONFIGPATH).&#xA;&#xA;After a bit of fussing with fish to get the variable set properly, I ended up with this in my shell config:&#xA;&#xA;set -gx RIPGREPCONFIG_PATH $HOME/.config/ripgreprc&#xA;&#xA;and this in my ripgreprc:&#xA;&#xA;--hidden&#xA;--glob=!.git/&#xA;&#xA;And now I&#39;m on to bigger and better (or at least different) problems.&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p><a href="http://natknight.xyz/tag:ripgrep" class="hashtag"><span>#</span><span class="p-category">ripgrep</span></a> <a href="http://natknight.xyz/tag:tool" class="hashtag"><span>#</span><span class="p-category">tool</span></a> <a href="http://natknight.xyz/tag:footgun" class="hashtag"><span>#</span><span class="p-category">footgun</span></a></p>

<p>I adore <a href="https://github.com/burntsushi/ripgrep">ripgrep</a>. It&#39;s fast, it&#39;s convenient, and I&#39;ve never wanted a feature and found it missing.</p>

<p>But no software is perfect, and today ripgrep was the program causing problems.</p>

<p><div style="border-radius: 1em; background: aliceblue; padding: 1em; border: 1px solid blue;">
<h2>Update</h2>
<p>Andrew Gallant (the author of RipGrep) <a href="https://bsky.app/profile/burntsushi.net/post/3lvt7jzqejc2v">kindly pointed out on BlueSky</a> that you can also address this by running a command in your repo:</p></p>

<pre><code>echo &#39;!/.github/&#39; &gt;&gt; .rgignore</code></pre>

<p><p>Thanks Andrew!</p>
</div>
</p>

<p>By default, ripgrep doesn&#39;t search everything. It checks your <code>.gitignore</code> for example, which is wonderful when you don&#39;t want to be searching all of <code>node_modules</code>. It also ignores <a href="https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory">hidden files</a> and that&#39;s what bit me today.</p>

<p>See GitHub Actions are stored under <code>.github/workflows/</code>, so when I removed a particular file and <code>rg</code>&#39;d through my whole codebase making sure it wasn&#39;t used anywhere I missed that it was used in some GitHub Actions.</p>

<p>Easily fixed, but how to make sure I don&#39;t get bit again?</p>

<p>We can search hidden files (but ignore <code>.git/</code>) with</p>

<pre><code>rg --hidden --glob=!.git/*
</code></pre>

<p>but that&#39;s a bit of a pain to type for a tool I use many times daily.</p>

<p>It turns out ripgrep does have a <a href="https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file">configuration file</a> that you can activate by setting an environment variable (<code>RIPGREP_CONFIG_PATH</code>).</p>

<p>After a bit of fussing with <a href="https://fishshell.com/docs/current/language.html">fish</a> to get the variable set properly, I ended up with this in my shell config:</p>

<pre><code class="language-fish">set -gx RIPGREP_CONFIG_PATH $HOME/.config/ripgreprc
</code></pre>

<p>and this in my <code>ripgreprc</code>:</p>

<pre><code>--hidden
--glob=!.git/*
</code></pre>

<p>And now I&#39;m on to bigger and better (or at least different) problems.</p>
]]></content:encoded>
      <guid>http://natknight.xyz/a-foot-gun-in-ripgrep</guid>
      <pubDate>Wed, 23 Jul 2025 23:49:28 +0000</pubDate>
    </item>
  </channel>
</rss>