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

Add an empty directory?

From
CBCarl Baldwin <cnb@fc.hp.com>
Date
Aug 13, 2005, 17:30 UTC
Message-ID
<20050813173043.GA25013@hpsvcnb.fc.hp.com>
Greetings,

My appologies if this has already been discussed. I've been through the archives but could easily have missed something.

I have found it useful in the past to have the ability to add an empty directory to the repository. With what little I know about git it seems that this is entirely possible. It would create an empty tree object for the new directory and insert a reference to that in the parent tree object.

If someone could get me started I think I could find the time to create and submit a patch to allow this. Here is what I've tried (with 0.99.4).

% mkdir test % cd test % git-init-db % mkdir dir % git-add-script dir error: open("dir"): No such file or directory fatal: Unable to add dir to database

Cheers, Carl

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Carl Baldwin                        Systems VLSI Laboratory
 Hewlett Packard Company
 MS 88                               work: 970 898-1523
 3404 E. Harmony Rd.                 work: Carl.N.Baldwin@hp.com
 Fort Collins, CO 80525              home: Carl@ecBaldwin.net
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Next: Petr Baudis
Message 1 of 7 in “Add an empty directory?”
  1. Carl BaldwinAug 13, 2005
  2. Petr BaudisAug 13, 2005
  3. Carl BaldwinAug 13, 2005
  4. Linus TorvaldsAug 13, 2005
  5. Petr BaudisAug 13, 2005
  6. Carl BaldwinAug 13, 2005
  7. Junio C HamanoAug 13, 2005

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.