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

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

From
Phil Hord <phil.hord@gmail.com>
Date
Mar 12, 2013, 15:39 UTC
Message-ID
<CABURp0pC2FELxM5aUwxuTqS1roZm+fwkCQA+BoXjrd0+yQMmbg@mail.gmail.com>
In-Reply-To
<5112C6F6.4030607@web.de>
On Wed, Feb 6, 2013 at 4:11 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
Show 20 quoted lines
> 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
> given. Fail if the current work tree contains modifications unless
> forced. Complain when for a submodule given on the command line the url
> setting can't be found in .git/config, but nonetheless don't fail.
>
> 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.
>
> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Probably because I was new to this command, I was confused by this output.
  $ git submodule deinit submodule
  rm 'submodule'
  Submodule 'submodule' (gerrit:foo/submodule) unregistered for path 'submodule'
  $ git rm submodule
  rm 'submodule'
This line is confusing to me in the deinit command:
  rm 'submodule'

It doesn't mean what git usually means when it says this to me. See how the 'git rm' command says the same thing but means something different in the next command.

In the deinit case, git removes the workdir contents of 'submodule' and it reports "rm 'submodule'". In the rm case, git removes the submodule link from the tree and rmdirs the empty 'submodule' directory.

I think this would be clearer if 'git deinit' said
    rm 'submodule/*'
or maybe
    Removed workdir for 'submodule'
Is it just me?
Phil
Previous: Heiko VoigtNext: Junio C Hamano
Message 13 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.