title: How to use --commit-filter to exclude 20 commit in one git filter-branch pass?
body: <p>I need to clean 20 commits in a row from git history in bare repository.
  I try to use the following command, (notice, i do not want to write full-length hashes and try to use sub-string comparison):</p>
  
  <pre><code>git filter-branch -d /dev/shm/scratch --commit-filter '
   if [ ${GIT_COMMIT0:7} = e687d59 ] ||
      [ ${GIT_COMMIT0:7} = 58daf29 ] ||
      ...
      [ ${GIT_COMMIT0:7} = 682b2c2 ] ||
      [ ${GIT_COMMIT0:7} = 947db9e ];
      then
              skip_commit "$@";
      else
              git commit-tree "$@";
      fi' --tag-name-filter cat -- --all
  </code></pre>
  
  <p>But i instantly get message like:</p>
  
  <blockquote>
    <p>Rewrite 414840693169a74d052548c7a7a1bc5b06d3b79c (1/10360) (0 seconds
    passed, remaining 0 predicted)    git commit-tree: 49: git
    commit-tree: Bad substitution could not write rewritten commit</p>
  </blockquote>
  
  <p>There is somweting wrong either with OR condition or with sub-strings, i can't figure out.</p>
  
  <p>I also have additional question: how can i get log file with mapping old hash to a new one when <code>git filter-branch</code> completed it's job?</p>