Am 12.03.2013 17:22, schrieb Junio C Hamano:
> Phil Hord <> writes:
>> I think this would be clearer if 'git deinit' said
>>     rm 'submodule/*'
>> or maybe
>>     Removed workdir for 'submodule'
>> Is it just me?
> The latter may probably be better.  

Hmm, it doesn't really remove the directory but only empties it
(it recreates it a few lines after removing it together with its
contents). So what about

    Cleared directory 'submodule'

The attached interdiff suppresses the "rm 'submodule'" message
and issues the "Cleared ..." message after it successfully removed
the work tree. (But please note that it also prints this message
even if the submodule work tree is already empty, e.g. when you
deinit a submodule the second time)

diff --git a/ b/
index 204bc78..d003e8a 100755
--- a/
+++ b/
@@ -601,10 +601,12 @@ cmd_deinit()

                        if test -z "$force"
-                               git rm -n "$sm_path" ||
+                               git rm -qn "$sm_path" ||
                                die "$(eval_gettext "Submodule work tree 
'\$sm_path' contains local modifications; use '-f' to discard them")"
-                       rm -rf "$sm_path" || say "$(eval_gettext "Could not 
remove submodule work tree '\$sm_path'")"
+                       rm -rf "$sm_path" &&
+                       say "$(eval_gettext "Cleared directory '\$sm_path'")" ||
+                       say "$(eval_gettext "Could not remove submodule work 
tree '\$sm_path'")"

                mkdir "$sm_path" || say "$(eval_gettext "Could not create empty 
submodule directory '\$sm_path'")"

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to