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

git-svn and empty directories in svn (was: [PATCH 1.2/2 (fixed)] git-svn: fix output reporting from the delta fetcher)

From
Seth Falcon <sethfalcon@gmail.com>
Date
Nov 29, 2006, 16:15 UTC
Message-ID
<m2slg2rzzj.fsf_-_@ziti.fhcrc.org>
In-Reply-To
<20061128201605.GA1369@localdomain>
Hi Eric, and list,
Eric Wong <normalperson@yhbt.net> writes:
Show 15 quoted lines
> Seth Falcon <sethfalcon@gmail.com> wrote:
>> I think that presently git-svn does not create empty dirs when pulling
>> from svn.  It would be nice to have such directories created since
>> some projects will expect the empty dir to be there (no need to track
>> it in git, IMO).
>
> Git itself cannot easily track empty directories (at least as far as
> update-index and checkout) goes.
>
> What I *can* do is run mktree and to force the creation of tree objects
> with a 4b825dc642cb6eb9a060e54bf8d69288fbee4904 (empty) sub tree and run
> commit-tree on it, but checkout/checkout-index would still need to be
> modified to support it.
>
> Is that something the git community wants?

I recently encountered a situation where code wasn't working for me because git-svn didn't create an empty dir that is present in svn.

I'm not trying to argue for the sense/anti-sense of tracking empty dirs in an scm, but I think this is an issue worth addressing in some fashion. Here's why.

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".

One simple thing (I think it would be simple) is that git-svn could issue a loud warning when it encounters an empty directory that it is going to ignore.

I don't understand the implications adding the tracking of empty dirs to git. I suspect it has been discussed before, but haven't yet gone fishing in the list archives. I imagine it would make the argument easier for folks wanting to switch a project from svn to git if this wasn't one of the differences. For good or bad, I've often heard this svn feature as a motivator to switch from cvs.

+ seth
Previous: Eric WongNext: Eric Wong
Message 11 of 14 in “git-svn: enable delta transfers during fetches when using SVN:: libs”
  1. 1/2 git-svn: enable delta transfers during fetches when using SVN:: libsEric Wong, Nov 28, 2006
  2. 1/2 git-svn: fix output reporting from the delta fetcherEric Wong, Nov 28, 2006
  3. 2/2 git-svn: fix output reporting from the delta fetcherEric Wong, Nov 28, 2006
  4. PazuNov 28, 2006
  5. PazuNov 28, 2006
  6. Seth FalconNov 28, 2006
  7. PazuNov 28, 2006
  8. Eric WongNov 28, 2006
  9. PazuNov 28, 2006
  10. Eric WongNov 28, 2006
  11. git-svn and empty directories in svn (was: [PATCH 1.2/2 (fixed)] git-svn: fix output reporting from the delta fetcher)Seth Falcon, Nov 29, 2006
  12. Eric WongDec 3, 2006
  13. Steven GrimmDec 3, 2006
  14. Eric WongDec 4, 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.