保存文件时出现错误

时间:2015-07-01 08:46:44

标签: android eclipse git egit

由于我已升级到eclipse mars(4.5),因此在每个文件保存,每个项目构建/清理以及其他一些场合都会抛出正则表达式PatternSyntaxException异常。之后,文件不会出现在未分级的更改列表中,基本上渲染对于此项目来说无用。

这是错误日志条目:

!ENTRY org.eclipse.core.jobs 4 2 2015-07-01 10:27:42.183
!MESSAGE An internal error occurred during: "Computing Git status for repository I-Sail".
!STACK 0
java.util.regex.PatternSyntaxException: Illegal repetition
{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf200
at java.util.regex.Pattern.error(Pattern.java:1924)
at java.util.regex.Pattern.closure(Pattern.java:3104)
at java.util.regex.Pattern.sequence(Pattern.java:2101)
at java.util.regex.Pattern.expr(Pattern.java:1964)
at java.util.regex.Pattern.compile(Pattern.java:1665)
at java.util.regex.Pattern.<init>(Pattern.java:1337)
at java.util.regex.Pattern.compile(Pattern.java:1022)
at org.eclipse.jgit.ignore.internal.Strings.convertGlob(Strings.java:352)
at org.eclipse.jgit.ignore.internal.WildCardMatcher.<init>(WildCardMatcher.java:66)
at org.eclipse.jgit.ignore.internal.PathMatcher.createNameMatcher0(PathMatcher.java:145)
at org.eclipse.jgit.ignore.internal.PathMatcher.createPathMatcher(PathMatcher.java:127)
at org.eclipse.jgit.ignore.FastIgnoreRule.<init>(FastIgnoreRule.java:112)
at org.eclipse.jgit.ignore.IgnoreNode.parse(IgnoreNode.java:114)
at org.eclipse.jgit.treewalk.WorkingTreeIterator$PerDirectoryIgnoreNode.load(WorkingTreeIterator.java:1215)
at org.eclipse.jgit.treewalk.WorkingTreeIterator$RootIgnoreNode.load(WorkingTreeIterator.java:1236)
at org.eclipse.jgit.treewalk.WorkingTreeIterator.getIgnoreNode(WorkingTreeIterator.java:648)
at org.eclipse.jgit.treewalk.WorkingTreeIterator.isEntryIgnored(WorkingTreeIterator.java:616)
at org.eclipse.jgit.treewalk.WorkingTreeIterator.isEntryIgnored(WorkingTreeIterator.java:599)
at org.eclipse.jgit.treewalk.WorkingTreeIterator.isEntryIgnored(WorkingTreeIterator.java:586)
at org.eclipse.jgit.treewalk.filter.IndexDiffFilter.include(IndexDiffFilter.java:190)
at org.eclipse.jgit.treewalk.filter.AndTreeFilter$List.include(AndTreeFilter.java:163)
at org.eclipse.jgit.treewalk.TreeWalk.next(TreeWalk.java:572)
at org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:434)
at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.calcIndexDiffDataFull(IndexDiffCacheEntry.java:534)
at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.access$6(IndexDiffCacheEntry.java:523)
at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$4.run(IndexDiffCacheEntry.java:290)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

问题似乎只发生在Android项目上。其他java项目,以及symfony / php网站工作正常。它的发生与我是否为项目创建一个新的git存储库无关,或者使用我以前在更新之前工作正常的旧存储库。我尝试重新安装egit插件,没有结果。 当我在同一个存储库的命令行中使用git时,一切都很好。

从错误消息中我会说某个文件以rtf格式保存,而egit期望以普通的txt格式保存。但是,我不知道这可能是哪个文件或如何找到它。

1 个答案:

答案 0 :(得分:3)

从查看堆栈跟踪看,问题可能出现在某个.gitignore文件中;应该包含regexp,而{是regexp重复语法。

那可能存在于存储库中,或者更有可能在某些地方发现它而普通的git没有,例如无论您对$ HOME的系统解释是什么。

请参阅:https://help.github.com/articles/ignoring-files/#create-a-global-gitignore