def min_hash_length():
    try:
        out = __git_raw('rev-list', '--all', '--abbrev=0',
                        '--abbrev-commit').stdout
    except ErrorReturnCode:
        return 0

    min_accepted = 7

    # build a set of commit hash lengths
    commits = {
        len(commit) for commit in out.split('\n') if len(commit) >= min_accepted
    }

    if len(commits) > 0:
        # pick the max
        return max(commits)

    return min_accepted
Determines the minimum length of an hash string for this repository
dataset/ETHPy150Open manuelbua/gitver/gitver/git.py/min_hash_length