Git-svn W:-empty_dir警告。他们的意思是什么? [英] Git-svn W: -empty_dir warnings. What do they mean?

查看:323
本文介绍了Git-svn W:-empty_dir警告。他们的意思是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用标准布局使用git-svn克隆现有的Subversion存储库时,我得到了一堆 W:-empty_dir (和 W :+ empty_dir )警告。克隆的git仓库似乎正在工作,也就是说,我可以做常用的git操作和dcommit到SVN仓库。



真正的问题是最初的克隆和rebase会创建一些空的SVN存储库中不存在的目录(位于存储库顶部)以及其他trunk目录中。这些目录不包含文件,而只包含一些空目录。看起来W:-empty_dir警告与这些空目录相对应。

我通过使用SVN检出整个存储库来查找空目录,但没有空目录。我还通过SVN检查了存储库中是否包含具有特殊属性的文件,但除可执行文件和mime-type之外没有其他文件。



不是最初遵循标准布局,但我清理它,以便顶级目录只是主干,标签和分支。



什么可以是导致创建这些在Subversion下不存在的空目录?

解决方案

通过使用 - rmdir 命令行选项或可以告诉 git-svn svn.rmdir 配置选项。



请参阅 git-svn OPTIONS 手册页和


如果没有文件留下,请从SVN树中删除目录。

SVN可以版本为空rectories,并且如果没有其他文件,它们不会被默认删除。 git不能版本清空目录。

启用此标志将使SVN的提交像git一样行事。







警告来自SVN标签(它们是目录),不受git-svn支持,如 git svn 中断,然后我丢失了所有的标签,如何解决?
From this thread


SVN跟踪目录,git不会,所以空目录不能在git中表示。

这些文件警告似乎告诉你哪些文件被删除,导致一个空目录在那个特定的 svn commit 被导入。


-empty_dir + empty_dir 之间的区别大约是空目录的显示方式SVN回购:

-empty_dir





+ empty_dir 一堆文件被删除,留下一个目录(分支或标签)



在导入的SVN修订版本中刚刚创建了空分支或标记, git-svn won' t导入一个空目录。






请注意,您可以在该警告后重新启动导入


While trying to clone an existing Subversion repository using git-svn using standard layout, I got a bunch of W: -empty_dir (and W: +empty_dir) warnings. The cloned git repository seems to be working, i.e. I can do usual git operations and dcommit to SVN repository.

The real problem is that the initial clone and rebase create some empty directories that do not exist in SVN repository, at the top of the repository (along with other directories in trunk). These directories contain no file but just some empty directories inside them. It seems that the "W: -empty_dir" warnings correspond to these empty directories.

I looked for empty directories by checking out the whole repository using SVN, but there is no empty directory. I also checked through SVN if the repository has files with special properties, but there was not any other than "executable" and "mime-type".

The existing repository was not originally following the standard layout, but I cleaned it up so that the top directories are just "trunk", "tags", and "branches".

What can be causing the creation of these empty directories that do not exist under Subversion?

解决方案

Without knowing exactly where those empty directories came from, you could tell git-svn to remove them by using the --rmdir command line option or svn.rmdir configuration option.

See git-svn OPTIONS man page and

Remove directories from the SVN tree if there are no files left behind.
SVN can version empty directories, and they are not removed by default if there are no files left in them. git cannot version empty directories.
Enabling this flag will make the commit to SVN act like git.


The warning comes from SVN tags (which are "directories") not supported by git-svn, as in "git svn interrupted, then I lost all the tags, how to fix it?".
From this thread:

SVN tracks directories, git doesn't, so empty directories cannot be represented in git.
Those warnings on files seem to tell you which files that got deleted, causing an empty directory to be left in place, in that particular svn commit being imported.

The difference between -empty_dir and +empty_dir is about how the empty directory appears in the SVN repo:

-empty_dir

A bunch of files are deleted, leaving a directory (branch or tag) empty.

+empty_dir

An empty branch or tag has just been created in the SVN revision being imported, and git-svn won't import an empty directory.


Note that you can restart the import after that warning.

这篇关于Git-svn W:-empty_dir警告。他们的意思是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆