]> git.ipfire.org Git - thirdparty/git.git/commit - git-submodule.sh
submodule: add 'deinit' command
authorJens Lehmann <Jens.Lehmann@web.de>
Mon, 4 Mar 2013 21:20:24 +0000 (22:20 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Mar 2013 22:48:02 +0000 (14:48 -0800)
commitcf419828064d4f22a2c3134e7b46a7719462b1dc
tree5177f7dc7729576bedce02f3e218663bd7893534
parentf94c3251e1400c3cf349f7f84fea4db66b540113
submodule: add 'deinit' command

With "git submodule init" the user is able to tell git he cares about one
or more submodules and wants to have it populated on the next call to "git
submodule update". But currently there is no easy way he could tell git he
does not care about a submodule anymore and wants to get rid of his local
work tree (except he knows a lot about submodule internals and removes the
"submodule.$name.url" setting from .git/config together with the work tree
himself).

Help those users by providing a 'deinit' command. This removes the
whole submodule.<name> section from .git/config (either for the given
submodule(s) or for all those which have been initialized if '.' is used)
together with their work tree. Fail if the current work tree contains
modifications (unless forced), but don't complain when either the work
tree is already removed or no settings are found in .git/config.

Add tests and link the man pages of "git submodule deinit" and "git rm"
to assist the user in deciding whether removing or unregistering the
submodule is the right thing to do for him. Also add the deinit subcommand
to the completion list.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rm.txt
Documentation/git-submodule.txt
contrib/completion/git-completion.bash
git-submodule.sh
t/t7400-submodule-basic.sh