code: def _gitignore_entry_to_regex(entry):
      
      ret = entry.strip()
      ret = ret.replace('.', '\.')
      ret = ret.replace('*', '.*')
      return ret
docs: Take a path that you might find in a .gitignore file and turn it into a regex