def shorten_hashes(res, length=7):
    for key in 'sha', 'tree_sha', 'object', 'commit_sha', 'top_tree_sha':
        if key in res and isinstance(res[key], basestr):
            res[key] = res[key][:length]
dataset/ETHPy150Open gvalkov/git-link/gitlink/utils.py/shorten_hashes/original