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

Re: Handling empty directories in Git

From
OROlivier LE ROY <olivier_le_roy@yahoo.com>
Date
Apr 8, 2014, 17:47 UTC
Message-ID
<1396979249.39960.YahooMailNeo@web120805.mail.ne1.yahoo.com>
In-Reply-To
<3FBDE5D3-1DC6-420C-866B-036D0CB17BA2@kellerfarm.com>
Hello Andrew,
yes that is possible to have scripts create the missing directories.
The reason I asked this is people at my work want to avoid the hassle of having to create a script for that. They want to checkout seamlessly as they used to do with subversion.
I guess it is similar as programming in Java and programming in plain old C.
Olivier LE ROY 

________________________________ De : Andrew Keller <andrew@kellerfarm.com> À : Olivier LE ROY <olivier_le_roy@yahoo.com> Cc : "git@vger.kernel.org" <git@vger.kernel.org> Envoyé le : Mardi 8 avril 2014 17h02 Objet : Re: Handling empty directories in Git

On Apr 8, 2014, at 10:47 AM, Olivier LE ROY <olivier_le_roy@yahoo.com> wrote:
Show 9 quoted lines
> Hello, 
> 
> I have a project under SVN with contains empty directories.
> 
> I would like to move this project on a Git server, still handling empty directories.
> 
> The solution: put a .gitignore file in each empty directory to have them recognized by the Git database cannot work, because some scripts in my projects test the actual emptiness of the directories.
> 
> Is there any expert able to tell me: this cannot be done in Git, or this can be done by the following trick, or why there is no valuable reason to maintain empty directories under version control?
Git is designed to track files.  The existence of folders is secondary to the notion that files have a relative path inside the repository, which is perceived by the user as folders.
Why can't your scripts create the folders on demand?  Or, could your scripts interpret a missing folder as an empty folder?

Thanks, Andrew Keller

Previous: Andrew KellerNext: Matthieu Moy
Message 4 of 9 in “Handling empty directories in Git”
  1. Olivier LE ROYApr 8, 2014
  2. Andrew KellerApr 8, 2014
  3. Andrew KellerApr 8, 2014
  4. Olivier LE ROYApr 8, 2014
  5. Matthieu MoyApr 8, 2014
  6. David KastrupApr 8, 2014
  7. Olivier LE ROYApr 8, 2014
  8. Olivier LE ROYApr 8, 2014
  9. Øyvind A. HolmApr 11, 2014

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.