title: Why don't my git clean and smudge filters work when committing programmatically?
body: <p>As part of a small web application I'm version controlling the SQLite DB. I've set up clean and smudge filters in order to store the DB on the remote repository as SQL rather than binary, so I can actually read its entries there.</p>
  <p>How I've accomplished this:</p>
  <pre class="lang-sh prettyprint-override"><code>$ git config --global filter.sqlite3tosql.clean &quot;sqlite3 %f .dump&quot;
  $ git config --global filter.sqlite3tosql.smudge &quot;sqlite3 %f&quot;
  $ echo &quot;*.db filter=sqlite3tosql&quot; &gt; /etc/gitattributes
  </code></pre>
  <p>This works when I do manual commits, but when I do programmatic commits from the web app–</p>
  <pre class="lang-py prettyprint-override"><code>subprocess.call(&quot;git add /home/appuser/repo/db.db&quot;, shell=True)
  subprocess.call(&quot;git commit -m 'update db'&quot;, shell=True)
  subprocess.call(&quot;git push origin master&quot;, shell=True)
  </code></pre>
  <p>–the filters are somehow ignored. The commit and push succeed, but the SQLite is stored as binary.</p>
  <p>What am I missing here?</p>
  <p>For thoroughness, here's the permissions for the gitattributes file:</p>
  <pre class="lang-sh prettyprint-override"><code>$ ls -l /etc/gitattributes
  -rw-r--r-- 1 root root 25 Nov 18 07:27 /etc/gitattributes
  </code></pre>
  <p>My user belongs to sudoers, and the app is run via systemd and gunicorn using my user and group (not root). I ran the <code>git config --global</code> calls as my user -- not root or the app user.</p>
  <p>I also tried</p>
  <pre class="lang-sh prettyprint-override"><code>$ echo &quot;*.db filter=sqlite3tosql&quot; &gt; ~/.config/git/attributes
  $ echo &quot;*.db filter=sqlite3tosql&quot; &gt; /home/appuser/.config/git/attributes
  $ ls -l ~/.config/git/attributes
  -rw-r--r-- 1 myuser www-data 25 Nov 18 07:55 /home/myuser/.config/git/attributes
  $ ls -l /home/appuser/.config/git/attributes
  -rw-r--r-- 1 myuser www-data 25 Nov 18 07:55 /home/appuser/.config/git/attributes
  </code></pre>
  <p>but this didn't help the situation.</p>