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

Re: [PATCH] Add git-submodule command

From
Simon Hausmann <simon@lst.de>
Date
May 26, 2007, 14:37 UTC
Message-ID
<200705261638.00302.simon@lst.de>
In-Reply-To
<11801878003599-git-send-email-hjemli@gmail.com>

On Saturday 26 May 2007 15:56:40 Lars Hjemli wrote: [...]

Show 24 quoted lines
> +modules_init()
> +{
> +	git ls-files --stage -- "$@" | grep -e '^160000 ' |
> +	while read mode sha1 stage path
> +	do
> +		# Skip submodule paths that already contain a .git directory.
> +		# This will also trigger if $path is a symlink to a git
> +		# repository
> +		test -d "$path"/.git && continue
> +
> +		# If there already is a directory at the submodule path,
> +		# expect it to be empty (since that is the default checkout
> +		# action) and try to remove it.
> +		# Note: if $path is a symlink to a directory the test will
> +		# succeed but the rmdir will fail. We might want to fix this.
> +		if test -d "$path"
> +		then
> +			rmdir "$path" 2>/dev/null ||
> +			die "Directory '$path' exist, but is neither empty "
> +			    "nor a git repository"
> +		fi
> +
> +		test -e "$path"
> +		die "A file already exist at path '$path'"
Isn't there a && missing at the end of the test line? :)
Simon
Previous: Lars HjemliNext: Lars Hjemli
Message 21 of 26 in “Add git-submodule command”
  1. Add git-submodule commandLars Hjemli, May 25, 2007
  2. Johannes SchindelinMay 25, 2007
  3. Johannes SchindelinMay 25, 2007
  4. Lars HjemliMay 25, 2007
  5. Johannes SchindelinMay 25, 2007
  6. Lars HjemliMay 25, 2007
  7. Johannes SchindelinMay 25, 2007
  8. Lars HjemliMay 25, 2007
  9. Add git-submodule commandLars Hjemli, May 25, 2007
  10. Johannes SchindelinMay 25, 2007
  11. Junio C HamanoMay 25, 2007
  12. Lars HjemliMay 25, 2007
  13. Junio C HamanoMay 25, 2007
  14. Lars HjemliMay 25, 2007
  15. Add git-submodule commandLars Hjemli, May 26, 2007
  16. Johannes SchindelinMay 26, 2007
  17. Junio C HamanoMay 26, 2007
  18. Lars HjemliMay 26, 2007
  19. Johannes SchindelinMay 26, 2007
  20. Add git-submodule commandLars Hjemli, May 26, 2007
  21. Simon HausmannMay 26, 2007
  22. Lars HjemliMay 26, 2007
  23. Johannes SchindelinMay 25, 2007
  24. Linus TorvaldsMay 25, 2007
  25. Johannes SchindelinMay 25, 2007
  26. Lars HjemliMay 25, 2007

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.