英文:
Use path of subdirectory for svn:ignore property
问题
我只想设置项目根目录中的 svn:ignore
属性,这样我只需要跟踪一个地方。所以我尝试包括 test/test_samples/*_dex.txt
,但是当我尝试提交时,该文件仍然列在非版本控制下。
为了证明一般来说,我只在 test/test_samples
目录中包括 *_dex.txt
,这按预期工作。我还尝试了 / 和 \,因为我在Windows上工作。
还有其他解决方法吗?
英文:
I only want to set the svn:ignore
property in the project root directory, so I only have to keep track of one place. So I tried to include test/test_samples/*_dex.txt
, but the file is still listed under non-versioned when I try to commit.
To prove that generally speaking I included *_dex.txt
only in the test/test_samples
directory, which worked as expected. I also tried / and , as I am working on Windows.
Any other idea how to solve this?
答案1
得分: 1
Subversion期望您在每个目录中设置文件名或通配符。因此,在项目的根目录中设置路径将不起作用。
引用自《忽略未版本化的项目》(重点在于我):
另一种方式(即设置svn:ignore)利用了Subversion的目录属性支持[...]。这两种机制都使用文件模式(一系列用于匹配文件名的文字和特殊通配符字符)来决定要忽略哪些文件。
虽然它没有说明svn:ignore
属性不从父目录继承,但唯一明确继承的属性是svn:mergeinfo
(请参阅Mergeinfo)。
我猜测Subversion只是查看当前目录的svn:ignore
属性,而不费心去查找上级目录。
为了完整起见,还有全局忽略模式(主要用于编辑器的备份和交换文件)。在您的情况下,这些似乎不太可能是一个好的解决方案。
因此,您将不得不选择分散的解决方案,并在目录test/test_samples
上设置svn:ignore
属性为*_dex.txt
。
英文:
Subversion expects you to set file names or wildcards per directory. So setting a path in the project's root will not work.
Quoting from Ignoring Unversioned Items in the Red Bean Book (emphasis mine):
> The other way [i.e. setting svn:ignore] makes use of Subversion's directory property support [...]. Both of the mechanisms use file patterns (strings of literal and special wildcard characters used to match against filenames) to decide which files to ignore.
While it does not state that the svn:ignore
property was not inherited from parent directories, the only property that is explicitly inherited is svn:mergeinfo
(see Mergeinfo)
I would guess that subversion simply looks at the svn:ignore
property of the current directory without bothering to go up the tree.
For the sake of completeness, there are also global ignore patterns (mostly used for editors' backup and swap files). It seems unlikely these are a good solution in your case.
So you will have to go for the decentralized solution and set the svn:ignore
property on directory test/test_samples
to *_dex.txt
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论