title: Can I escape chars in git log output?
body: <p>I want to post process the output of <code>git log</code> and have been playing with the <code>--pretty</code> settings. When I e.g. do </p>
  
  <pre><code>--pretty=format:'{"sha":"%h","message":"%B","author":"%aN &lt;%aE&gt;","commit":"%cE","date":"%cD"}
  </code></pre>
  
  <p>I get some JSON-like output; when I put in a <code>{</code> or <code>}</code> or even a <code>"</code> into the commit message this messes up my output.</p>
  
  <p>Is there a way to tell <code>git log</code> to escape those chars e.g. by prepending a <code>\</code>?</p>
  
  <p>There are two similar questions <a href="https://stackoverflow.com/questions/4600445/git-log-output-to-xml-json-or-yaml">Git log output to XML, JSON or YAML</a> and <a href="https://stackoverflow.com/questions/6327276/parsing-git-log-output-preferably-as-xml">Git log output preferably as XML</a>, but they both do not address the escaping of the special chars (e.g. if in the XML case I put <code>&lt;foo&gt;</code> in my commit message, the resulting XML will be broken).</p>