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

Re: Add an empty directory?

From
Petr Baudis <pasky@suse.cz>
Date
Aug 13, 2005, 18:00 UTC
Message-ID
<20050813180008.GJ5608@pasky.ji.cz>
In-Reply-To
<20050813173043.GA25013@hpsvcnb.fc.hp.com>

Dear diary, on Sat, Aug 13, 2005 at 07:30:43PM CEST, I got a letter where Carl Baldwin <cnb@fc.hp.com> told me that...

> Greetings,
Hi,
Show 20 quoted lines
> 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

the object databases supports it, but the index file does not. But yes, it should be supported, I think.

Some argue that this is useless, so some practical example of its usefulness might be a good motivation to get us going. :-)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox
Previous: Carl BaldwinNext: Carl Baldwin
Message 2 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.