From: Heiko Voigt <hvoigt@hvoigt.net>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: Junio C Hamano <gitster@pobox.com>,
Phil Hord <phil.hord@gmail.com>,
Git Mailing List <git@vger.kernel.org>,
Michael J Gruber <git@drmicha.warpmail.net>,
Marc Branchaud <marcnarc@xiplink.com>,
"W. Trevor King" <wking@tremily.us>
Subject: Re: [PATCH v6] submodule: add 'deinit' command
Date: Tue, 5 Mar 2013 08:29:46 +0100 [thread overview]
Message-ID: <20130305072944.GA4677@sandbox-ub> (raw)
In-Reply-To: <51351018.20301@web.de>
Hi,
On Mon, Mar 04, 2013 at 10:20:24PM +0100, Jens Lehmann wrote:
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 004c034..44f70c4 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -547,6 +548,80 @@ cmd_init()
> }
>
[...]
> +
> + module_list "$@" |
> + while read mode sha1 stage sm_path
> + do
> + die_if_unmatched "$mode"
> + name=$(module_name "$sm_path") || exit
> +
> + # Remove the submodule work tree (unless the user already did it)
> + if test -d "$sm_path"
> + then
> + # Protect submodules containing a .git directory
> + if test -d "$sm_path/.git"
> + then
> + echo >&2 "$(eval_gettext "Submodule work tree '\$sm_path' contains a .git directory")"
> + die "$(eval_gettext "(use 'rm -rf' if you really want to remove it including all of its history)")"
> + fi
> +
> + if test -z "$force"
> + then
> + git rm -n "$sm_path" ||
> + die "$(eval_gettext "Submodule work tree '\$sm_path' contains local modifications; use '-f' to discard them")"
Minor nit. IMO, there is an indentation for the || missing here. Maybe
Junio can squash that in on his side?
> + fi
> + rm -rf "$sm_path" || say "$(eval_gettext "Could not remove submodule work tree '\$sm_path'")"
> + fi
> +
> + mkdir "$sm_path" || say "$(eval_gettext "Could not create empty submodule directory '\$sm_path'")"
[...]
Everything else looks good to me.
Cheers Heiko
next prev parent reply other threads:[~2013-03-05 7:30 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 21:11 [PATCH v4] submodule: add 'deinit' command Jens Lehmann
2013-02-12 17:11 ` Phil Hord
2013-02-12 18:03 ` Junio C Hamano
2013-02-13 19:33 ` Jens Lehmann
2013-02-13 19:56 ` Junio C Hamano
2013-02-17 20:06 ` [PATCH v5] " Jens Lehmann
2013-02-17 22:32 ` Junio C Hamano
2013-02-18 19:20 ` Jens Lehmann
2013-03-04 21:20 ` [PATCH v6] " Jens Lehmann
2013-03-05 7:29 ` Heiko Voigt [this message]
2013-03-05 15:45 ` Junio C Hamano
2013-03-06 6:52 ` Heiko Voigt
2013-03-12 15:39 ` [PATCH v4] " Phil Hord
2013-03-12 16:22 ` Junio C Hamano
2013-03-18 20:54 ` Jens Lehmann
2013-03-19 1:45 ` Junio C Hamano
2013-04-01 19:02 ` [PATCH] submodule deinit: clarify work tree removal message Jens Lehmann
2013-04-16 13:32 ` Phil Hord
2013-04-16 20:47 ` [PATCH] submodule deinit: don't output "Cleared directory" when directory is empty Jens Lehmann
2013-04-17 5:16 ` [PATCH] submodule deinit: clarify work tree removal message Junio C Hamano
2013-04-17 20:30 ` Jens Lehmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130305072944.GA4677@sandbox-ub \
--to=hvoigt@hvoigt.net \
--cc=Jens.Lehmann@web.de \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=marcnarc@xiplink.com \
--cc=phil.hord@gmail.com \
--cc=wking@tremily.us \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).