move setup_alternate_shallow and write_shallow_commits to shallow.c