def _get_submodules():
    import sh
    git = sh.git.bake(_tty_out=False)
    return [
        line.strip()[1:].split()[1]
        for line in git.submodule()
    ]
returns something like
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/hqadmin/views.py/_get_submodules