简体   繁体   English

如何查看使用svn设置的所有忽略模式:在SVN存储库中递归忽略?

[英]How do I view all ignored patterns set with svn:ignore recursively in an SVN repository?

I see it is possible to view a list of properties set on every directory within an SVN repository using proplist and the -R flag (recursive) and -v flag (verbose): 我看到可以使用proplist和-R标志(递归)和-v标志(详细)查看SVN存储库中每个目录上设置的属性列表:

svn proplist -Rv

This shows me all properties, such as svn:mime-type or svn:executable. 这显示了所有属性,例如svn:mime-type或svn:executable。 I'm looking to filter this to just svn:ignore properties. 我想过滤这个只是svn:ignore属性。 I'm sure there is some way to pipe the result from this command through a shell command that would only show me the lines I'm interested in, but I can't figure out how to do it. 我确信有一些方法可以通过一个shell命令来管理这个命令的结果,这个命令只能显示我感兴趣的行,但我无法弄清楚如何去做。 As an example of the type of thing that would be most useful is some type of command like this (but this one doesn't work!). 作为最有用的东西类型的例子是这样的某种类型的命令(但是这个不起作用!)。

svn proplist -Rv | grep "^  svn:ignore" | awk "{print \$1}"

I just don't know enough about shell commands like grep and awk to make this work for me. 我只是不太了解像grepawk这样的shell命令,这对我有用。 This just shows "svn:ignore" over and over again, but it doesn't print out the directory path or contents of the svn:ignore property. 这只是一遍又一遍地显示“svn:ignore”,但它不会打印出目录路径或svn:ignore属性的内容。 Here is an example of the output from "svn proplist -Rv" that I'd like to grab, where 'cache' is the path and '*' is the value of the property. 以下是我想要获取的“svn proplist -Rv”输出的示例,其中'cache'是路径,'*'是属性的值。

Properties on 'cache':
  svn:ignore
    *

How can the above command be made to work and/or is there a better way to view all svn:ignore properties in my repository? 如何使上述命令工作和/或是否有更好的方法来查看我的存储库中的所有svn:ignore属性?

svn pg -R svn:ignore .

...用pg作为propget的简写符号,所以这等于......

svn propget -R svn:ignore .

Sorry to jump in here late, but there is a simple solution here. 很抱歉这里迟到了,但这里有一个简单的解决方案。

Just grep. 只是grep。

svn proplist -Rv | grep svn:ignore -B1 -A1

Show one line before, and one line after the match. 之前显示一行,匹配后显示一行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM