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

Packing empty subtrees: good/bad/indifferent?

From
Shawn Pearce <spearce@spearce.org>
Date
Jun 20, 2006, 00:09 UTC
Message-ID
<20060620000958.GA4877@spearce.org>

So in my Eclipse plugin/Java GIT implementation I'm trying to figure out what to do if the API caller feeds me a subtree which is empty.

Core GIT won't store an empty subtree simply because the subtree can't exist in the index without at least one file in the tree. But my Java implementation doesn't suffer from that limitation and will happily store an empty subtree (and checkout an empty directory) if that is what the caller gave it. :-)

In the plugin's UI level I'm trying relatively hard to refuse putting an empty directory into the repository as an empty subtree but I'm now wondering if I should enforce that even lower (like down in the actual tree writer) just to be on the safe side.

Anyone have two cents they could share on the matter?
-- 
Shawn.
Message 1 of 1 in “Packing empty subtrees: good/bad/indifferent?”
  1. Shawn PearceJun 20, 2006

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.