wrap in a main function
expand newlines in output
switch to top level directory to prepare submodules
only fetch when the EXPECTED_HEAD is unknown