git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v6] submodule: add 'deinit' command

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Mar 5, 2013, 07:29 UTC
Message-ID
<20130305072944.GA4677@sandbox-ub>
In-Reply-To
<51351018.20301@web.de>
Hi,
On Mon, Mar 04, 2013 at 10:20:24PM +0100, Jens Lehmann wrote:
Show 7 quoted lines
> 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()
>  }
> 
[...]
Show 21 quoted lines
> +
> +	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?

Show 5 quoted lines
> +			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
Previous: Jens LehmannNext: Junio C Hamano
Message 10 of 21 in “submodule: add 'deinit' command”
  1. submodule: add 'deinit' commandJens Lehmann, Feb 6, 2013
  2. Phil HordFeb 12, 2013
  3. Junio C HamanoFeb 12, 2013
  4. Jens LehmannFeb 13, 2013
  5. Junio C HamanoFeb 13, 2013
  6. submodule: add 'deinit' commandJens Lehmann, Feb 17, 2013
  7. Junio C HamanoFeb 17, 2013
  8. Jens LehmannFeb 18, 2013
  9. submodule: add 'deinit' commandJens Lehmann, Mar 4, 2013
  10. Heiko VoigtMar 5, 2013
  11. Junio C HamanoMar 5, 2013
  12. Heiko VoigtMar 6, 2013
  13. Phil HordMar 12, 2013
  14. Junio C HamanoMar 12, 2013
  15. Jens LehmannMar 18, 2013
  16. Junio C HamanoMar 19, 2013
  17. submodule deinit: clarify work tree removal messageJens Lehmann, Apr 1, 2013
  18. Phil HordApr 16, 2013
  19. submodule deinit: don't output "Cleared directory" when directory is emptyJens Lehmann, Apr 16, 2013
  20. Junio C HamanoApr 17, 2013
  21. Jens LehmannApr 17, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.