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

Re: [PATCH] Remove empty directories when checking out a commit with fewer submodules

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 11, 2010, 08:57 UTC
Message-ID
<alpine.DEB.1.00.1001110954410.4985@pacific.mpi-cbg.de>
In-Reply-To
<1263178794-3140-1-git-send-email-peter@pcc.me.uk>
Hi,
On Mon, 11 Jan 2010, Peter Collingbourne wrote:
> Change the unlink_entry function to use rmdir to remove submodule
> directories.

NAK. We should not even try to _unlink_ submodule subdirectories; it would be _way_ too easy to lose data that way. Remember, submodules are a totally different beast from regular files. They can contain valuable, yet uncommitted data, that is not even meant to be committed.

So you say if the submodule directories are empty, it is safe? Not so. They will never be empty: there is always .git/, and _that_ can contain valuable information that you do not want to throw away, too. Think of unpushed branches, for example. That would be _fatal_ if you rmdir() that for me.

So please, no, Dscho

Previous: Peter CollingbourneNext: Johan Herland
Message 2 of 5 in “Remove empty directories when checking out a commit with fewer submodules”
  1. Remove empty directories when checking out a commit with fewer submodulesPeter Collingbourne, Jan 11, 2010
  2. Johannes SchindelinJan 11, 2010
  3. Johan HerlandJan 11, 2010
  4. Johannes SchindelinJan 11, 2010
  5. Junio C HamanoJan 11, 2010

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.