如何在 SVN 操作期间将所有行结尾转换为 CRLF、LF 或 CR [英] How can I convert all line endings to CRLF, LF, or CR during SVN operations

查看:64
本文介绍了如何在 SVN 操作期间将所有行结尾转换为 CRLF、LF 或 CR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,您已经准备好进行大型 SVN Commit 并且它会爆炸,因为您的某些文件中的行尾不一致.有趣的是,您正在查看跨越数十个不同深度文件夹的 1000 个文件.

你在做什么?

解决方案

我不认为 pre-commit 钩子实际上可以更改正在提交的数据 - 它可以禁止提交,但我认为它不能为您进行转换.

听起来您想要属性 'svn:eol-style' 设置为 'native' - 这将自动将换行符转换为您平台上使用的任何内容(使用 'CRLF'、'CR' 或 'LF' 来获取这些,而不管操作系统想要什么).

您可以使用 auto-properties 以便您以后创建的所有文件都可以设置此属性(自动道具在客户端处理,因此您必须为每个用户设置此属性).

So, you are all ready to do a big SVN Commit and it bombs because you have inconsistent line endings in some of your files. Fun part is, you're looking at 1,000s of files spanning dozens of folders of different depths.

What do you do?

解决方案

I don't think the pre-commit hook can actually change the data that is being committed - it can disallow a commit, but I don't think it can do the conversion for you.

It sounds like you want the property 'svn:eol-style' set to 'native' - this will automatically convert newlines to whatever is used on your platform (use 'CRLF', 'CR' or 'LF' to get those regardless of what the OS wants).

You can use auto-properties so that all future files you create will have this property set (auto props are handled client-side, so you'd have to set this up for each user).

这篇关于如何在 SVN 操作期间将所有行结尾转换为 CRLF、LF 或 CR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆