submodule: prepare for recursive checkout of submodules

This commit adds the functions needed for configuration, for setting the
default behavior and for determining if a submodule path should be updated
automatically.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
submodule: teach unpack_trees() to remove submodule contents

Implement the functionality needed to tell checkout commands via a command
line option and/or configuration that a deleted submodule should not only
affect the index (leaving all the files of the submodule in the work tree)
but also to remove the work tree of the superproject as far as possible.

That will only work properly when the submodule uses a gitfile instead of
a .git directory and no untracked files are present. Otherwise the removal
will fail with a warning (which is just what happened until now).

Extend rmdir_or_warn() to remove all tracked files and the .gitfile of
those submodules which are scheduled for removal. Also teach
verify_clean_submodule() to check that a submodule configured to be
removed is not modified before scheduling it for removal.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
submodule: teach unpack_trees() to repopulate submodules

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
submodule: teach unpack_trees() to update submodules

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
!!! WIP !!! Teach checkout to recursively checkout submodules

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>