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

Preserving empty directories when doing a git-svn clone/rebase

From
SMSteven J. Murdoch <git+steven.murdoch@cl.cam.ac.uk>
Date
Nov 15, 2009, 02:06 UTC
Message-ID
<20091115020605.GE15966@cl.cam.ac.uk>

When git-svn clones a Subversion repository, any empty directories appear to be silently dropped (tested using git version 1.6.5.2 on Mac OS X Snow Leopard). This causes problems for using git with software projects which depend on Subversion's ability to track empty directories. I was recently caught out by this, and it was difficult to debug what had gone wrong.

Would it be possible to change git-svn to handle this case? Since git doesn't have the ability to track empty directories, probably the simplest thing to do would be to automatically add a file (e.g. .gitignore) to any empty directories. In theory this could cause problems, but I would think the chances of this are far lower than with the current behaviour.

I think this feature would help projects in which some contributors are transitioning to git. It would especially be useful to novice users of git, who are not aware of the potential problems with having empty directories.

I see there was a discussion in 2006:
 http://kerneltrap.org/mailarchive/git/2006/11/29/231586

However, since then I haven't seen any updates. The rationale behind the original request still seems applicable today:

 "I think there are many potential git users out there who are
 currently svn users.  And git-svn is a really nice way to get started,
 but this sort of stumbling block could really turn people off.  For
 example, it made me look pretty dumb when I carelessly complained to
 my colleague about his code not working and then it turns out to be
 because my super-advanced scm tool "messed things up"."
  (git-svn and empty directories in svn (was: [PATCH 1.2/2 (fixed)]
   git-svn: fix output reporting from the delta fetcher))

Thanks, Steven Murdoch.

-- 
http://www.cl.cam.ac.uk/users/sjm217/
Next: Todd A. Jacobs
Message 1 of 7 in “Preserving empty directories when doing a git-svn clone/rebase”
  1. Steven J. MurdochNov 15, 2009
  2. PEBKAC or bug: unable to create path-like branch namesTodd A. Jacobs, Nov 15, 2009
  3. Jacob HelwigNov 15, 2009
  4. Todd A. JacobsNov 15, 2009
  5. Jacob HelwigNov 15, 2009
  6. Daniel BarkalowNov 15, 2009
  7. Eric WongNov 16, 2009

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.