SVN 可以处理区分大小写的问题吗?
有没有办法强制 SVN 不区分大小写? 我们遇到一个问题,用户从 Linux 环境提交“file.ext”和“File.ext”文件。 效果很好。 然而,问题是当 MAC OSX 或 Windows 上的用户尝试更新/签出时。 这两个文件被认为是相同的,并且操作错误地失败。
有没有办法让 SVN 首先阻止提交“File.ext”和“file.ext”?
这个问题类似,但看起来相同的问题从 Windows 端来看,这不是这里的问题。
Is there a way to force SVN to be case insensitive? We have an issue where a user commits from a linux environment with files say "file.ext" and "File.ext". Works just fine. The problem, however, is when a user on a MAC OSX or Windows attempts an update/checkout. The two files are considered the same and the action fails in error.
Is there a way to have SVN prevent the committing of "File.ext" and "file.ext" in the first place?
This question is similar but looks at the same problem from the Windows side, which is not the issue here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以尝试预提交挂钩,例如 这个(不过我自己没有尝试过)。
我想让你的用户注意它的可能性已经被排除了? 我一直在 Linux 上工作,但通常认为文件名不区分大小写,即对我来说,它们是相同的,无论操作系统怎么想。
You could try a pre-commit hook, such as this one (didn't try it myself, however).
I assume that getting your users watch out for it has already been ruled out? I work on Linux all the time, but typically consider filenames case-insensitive, i. e. to me, they are the same, no matter what the OS thinks.
Subversion 1.7 现在似乎可以处理仅大小写重命名在 Windows 上。
Subversion 1.7 now appears to handle case only renames on Windows.
我想说的是,你看待事物的方式是错误的。 最好的解决方案是以区分大小写的方式维护文件。 如果用户在 Linux 或 Solaris 中签出,该项目将无法使用,该怎么办?
另外,考虑一些依赖于区分大小写的语言编译器,Java 编译器会抱怨文件名,我相信其他语言也会如此。
另一个问题是部署,如果部署在 *NIX 系统上怎么办? 那你就有麻烦了!
I would say you are looking at things the wrong way around. The best solution here is to maintain your files to a case sensitive manner. What if a user checks out in Linux or Solaris, the project will be unusable.
Also, consider some language compilers that depend on the case sensitivity, the Java compiler will complain about the file names, as I am sure other languages will.
Another issue, is deployment, what if you deploy on a *NIX system. Then your in trouble!
我认为技术问题确实出在 Mac 和 Mac 上。 Windows 端,即它们的文件系统不区分大小写。 至少在 Mac 上,您可以将文件系统重新格式化为 HFS+,并启用区分大小写。 我不是 Windows 用户,但 Windows 的本机文件系统中可能有类似的选项(仍然是 NTFS 吗?)。
如果您没有足够控制开发人员的环境来强制他们使用区分大小写的文件系统进行格式化,那么我认为您唯一的选择是预提交挂钩,用于检查重复的(显然不区分大小写的比较)文件名相同的目录或来修改您的项目,以便不在同一目录中使用具有相同名称和不同大小写的文件。
I think the technical problem really is on the Mac & Windows side, namely that their file systems aren't case-sensitive. At least on the mac, you can re-format the file system as HFS+ with case-sensitivity turned on. I'm not a Windows user but there may be a similar option in Windows' native file system (is it still NTFS?).
If you don't control the developer's environments enough to force them to format with a case-sensitive file system, then I think your only options are a pre-commit hook that checks for duplicate (case-insensitive comparison, obviously) file names in the same directory or to modify your project to not use files with the same name and different case in the same directory.