def strip_diff_things(text):
    """Remove things from the text that make it look like a diff.

    The purpose of this is so we can run guess_lexer over the source text. If
    we have a diff of Python, Pygments might tell us the language is "Diff".
    Really, we want it to highlight it like it's Python, and then we'll apply
    the diff formatting on top.
    """
    s = ''
    for line in text.splitlines():
        if line.startswith(('diff --git', '--- ', '+++ ', 'index ', '@@ ',
            'Author:', 'AuthorDate:', 'Commit:', 'CommitDate:', 'commit ')):
            continue
        if line.startswith(('+', '-')):
            line = line[1:]
        s += line + '\n'
    return s
