Open lancew opened 12 years ago
I think this feature would be nice.
This is definitely needed as (unfortunately) many build scripts rely on existing directories even if they are empty. As a workaround, one could use:
find . -type d -empty -exec touch {}/.gitignore \;
However this does not help in case svn2git handles multiple branches, trunks and tags as this command needs to be processed after git-svn command before the actual magic of svn2git.
+1 on this feature request. I migrated my project's SVN to GIT and it was a pain to identify why some stuff was failing: it was because some (empty) directories were missing. Solved it manually by adding an empty .gitignore
in the empty directory.
+1
+1 This feature would be helpful
+1
it's easy enough to add the code to preserve empty folders.
--- migration.rb.backup 2016-08-23 13:43:59.000000000 -0600
+++ migration.rb 2016-09-30 13:37:51.000000000 -0600
@@ -202,6 +202,10 @@
run_command(cmd, true, true)
end
+ # preserve empty directories
+ run_command("#{git_config_command} svn-remote.svn.preserve-empty-dirs true")
+ run_command("#{git_config_command} svn-remote.svn.placeholder-filename .gitkeep")
+
run_command("#{git_config_command} svn.authorsfile #{authors}") unless authors.nil?
cmd = "git svn fetch "
but sometimes I see this error half way through the import,
Failed to strip path '<some-path>/.gitkeep' ((?^:^trunk(/|$)))
command failed:
git svn fetch
It seems to be resolved by re-running git svn fetch and svn2git
There are some ideas in this post, but it all seems kind of hacky https://www.semitwist.com/articles/article/view/the-better-svn-git-guide
+1
It might be useful to have an option to handle empty directories. Perhaps something that would, when a empty directory is identified, create a empty flag file in that directory so git would maintain identical directory structure to svn? Thoughts?