从 svn diff 中排除 TortoiseSVN 的忽略提交文件
$svn diff > patchfile
创建一个漂亮的补丁文件。然而,在Windows下使用TortoiseSVN,我将一些文件设置为“提交时忽略”,也就是说,当我进行提交时,它处于版本控制之下但没有被选择。
TortoiseSVN 似乎通过 .svn/entries
中该文件的自定义条目来处理此问题。请注意,它不是普通的 SVN 属性(即无法通过 svn propget 获取)。
我的问题是,我想通过命令行(通过 Cygwin 的 bash 和 SVN 端口)创建一个补丁文件,但是这个补丁文件不应该包含带有“ignore-on-commit”标志的文件。
有谁知道如何做到这一点(除了使用 awk 递归遍历每个 .svn/entries
...)?
$svn diff > patchfile
creates a nice patchfile. However, using TortoiseSVN under Windows I've set some files as being "ignored-on-commit", that is, it is under version control but doesn't get selected, when i do a commit.
TortoiseSVN seemingly handles this via a custom entry in .svn/entries
for this file. Note, that it it isn't a normal SVN property (that is, not fetchable via svn propget).
My problem is, that I want to create a patch file via command line (via Cygwin's bash and SVN port), but this patch file should not include the files with this 'ignore-on-commit' flag.
Has anyone an idea how to do this (besides walking with awk recursively through each .svn/entries
...)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
显然这是一个特殊的变更列表条目。至于如何从命令行忽略文件,看起来没有 特别简单的方法。
Apparently it's a special changelist entry. As for how to then ignore the file/s from the command line, it doesn't look like there's a particularly easy way.
您可以通过文件上的“svn info”查看更改列表。并通过“svn Changelist”设置/重置更改列表
You can see the changelist via 'svn info' on the file. And set/reset changelists via 'svn changelist'
我也遇到过这个问题,因此开发了一个简单的命令链来满足需求:
svn st | grep -A 1000 '忽略提交' | grep -v '忽略提交' | sed 's/^.* //g' | xargs svn 差异 | gvim -
(假设在变更列表“ignore-on-commit”之外修改的文件少于 1000 个)
使用此命令,在变更列表“ignore-on-commit”之外修改的文件将被比较,并且在“ignore-on-commit”内没有文件修改on-commit' 将被包括在内。
I've had this problem too, and thus developed a simple command chain to server the need:
svn st | grep -A 1000 'ignore-on-commit' | grep -v 'ignore-on-commit' | sed 's/^.* //g' | xargs svn diff | gvim -
(Assuming there is less then 1000 files modified outside changelist 'ignore-on-commit')
Using this command, files modified outside changelist 'ignore-on-commit' will be diff-ed, and no file modification within 'ignore-on-commit' will be included.