如何在 SVN 存储库中递归查看使用 svn:ignore 设置的所有忽略模式?
我发现可以使用 proplist 以及 -R 标志(递归)和 -v 标志(详细)查看 SVN 存储库中每个目录上设置的属性列表:
svn proplist -Rv
这显示了所有属性,例如 svn:mime-type或 svn:可执行文件。 我希望将其过滤为仅 svn:ignore 属性。 我确信有某种方法可以通过 shell 命令传输此命令的结果,该命令只会显示我感兴趣的行,但我不知道该怎么做。 作为最有用的事物类型的一个例子是像这样的某种类型的命令(但这个不起作用!)。
svn proplist -Rv | grep "^ svn:ignore" | awk "{print \$1}"
我只是对 grep 和 awk 使这项工作适合我。 这只是一遍又一遍地显示“svn:ignore”,但它不会打印出 svn:ignore
属性的目录路径或内容。 这是我想要获取的“svn proplist -Rv”的输出示例,其中“cache”是路径,“*”是属性的值。
Properties on 'cache':
svn:ignore
*
如何使上述命令起作用和/或是否有更好的方法来查看我的存储库中的所有 svn:ignore 属性?
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):
svn proplist -Rv
This shows me all properties, such as svn:mime-type or svn:executable. I'm looking to filter this to just svn:ignore
properties. 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. 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. 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. 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.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
...
pg
是propget
的简写符号,所以这等于......with
pg
being a shorthand notation forpropget
, so this is equal to...很抱歉迟到了,但这里有一个简单的解决方案。
只需 grep 即可。
在比赛之前显示一行,在比赛之后显示一行。
Sorry to jump in here late, but there is a simple solution here.
Just grep.
Show one line before, and one line after the match.