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

Re: [RFC] git submodule purge

From
Patrick Steinhardt <ps@pks.im>
Date
Mar 17, 2015, 08:18 UTC
Message-ID
<20150317081826.GB354@pks-pc>
In-Reply-To
<xmqqmw3drl7s.fsf@gitster.dls.corp.google.com>
On Mon, Mar 16, 2015 at 08:55:03AM -0700, Junio C Hamano wrote:
Show 20 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > I think there should be a command that is able to remove those
> > dangling repositories if the following conditions are met:
> >
> > - the submodule should not be initialized
> >
> > - the submodule should not have an entry in .gitmodules in the
> >   currently checked out revision
> >
> > - the submodule should not contain any commits that are not
> >   upstream
> >
> > - the submodule should not contain other submodules that do not
> >   meet those conditions
> 
> I do not have a strong opinion on whether it is a good idea to make
> it possible to remove the .git/modules/*, but should it be a
> separate subcommand, or should it be an option to the 'deinit'
> subcommand?
See my response to Jonathan.
> Also, how would you apply the safety to a repository without
> "upstream", i.e. the authoritative copy?

Is it even possible to create a new submodule without any upstream repository? At least `git submodule init` does not work without a corresponding entry in .gitmodules which the user would have needed to create himself manually. In this case one _could_ assume that the user knows what he is doing and expect him not to call `submodule purge` (or whatever the command will be called) on the authoritative copy. Other than that I've got no idea how to assure safety.

Regards Patrick

Previous: Junio C HamanoNext: Fredrik Gustafsson
Message 3 of 11 in “[RFC] git submodule purge”
  1. Patrick SteinhardtMar 16, 2015
  2. Junio C HamanoMar 16, 2015
  3. Patrick SteinhardtMar 17, 2015
  4. Fredrik GustafssonMar 17, 2015
  5. Jonathan NiederMar 16, 2015
  6. Patrick SteinhardtMar 17, 2015
  7. Jens LehmannMar 23, 2015
  8. Patrick SteinhardtMar 25, 2015
  9. Jens LehmannMar 25, 2015
  10. Patrick SteinhardtMar 26, 2015
  11. Jens LehmannMar 26, 2015

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.