Determine the last sha if it is not defined yet