从 svn diff 中排除 TortoiseSVN 的忽略提交文件

发布于 2024-08-17 08:14:33 字数 416 浏览 6 评论 0原文

$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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

世界等同你 2024-08-24 08:14:33

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.

别闹i 2024-08-24 08:14:33

您可以通过文件上的“svn info”查看更改列表。并通过“svn Changelist”设置/重置更改列表

$ svn help cl
changelist (cl): Associate (or dissociate) changelist CLNAME with the named files.
usage: 1. changelist CLNAME TARGET...
       2. changelist --remove TARGET...

Valid options:
  -q [--quiet]             : print nothing, or only summary information
  -R [--recursive]         : descend recursively, same as --depth=infinity
  --depth ARG              : limit operation by depth ARG ('empty', 'files',
                            'immediates', or 'infinity')
  --remove                 : remove changelist association
  --targets ARG            : pass contents of file ARG as additional args
  --changelist ARG         : operate only on members of changelist ARG
                             [aliases: --cl]

You can see the changelist via 'svn info' on the file. And set/reset changelists via 'svn changelist'

$ svn help cl
changelist (cl): Associate (or dissociate) changelist CLNAME with the named files.
usage: 1. changelist CLNAME TARGET...
       2. changelist --remove TARGET...

Valid options:
  -q [--quiet]             : print nothing, or only summary information
  -R [--recursive]         : descend recursively, same as --depth=infinity
  --depth ARG              : limit operation by depth ARG ('empty', 'files',
                            'immediates', or 'infinity')
  --remove                 : remove changelist association
  --targets ARG            : pass contents of file ARG as additional args
  --changelist ARG         : operate only on members of changelist ARG
                             [aliases: --cl]
美人迟暮 2024-08-24 08:14:33

我也遇到过这个问题,因此开发了一个简单的命令链来满足需求:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文