首页 \ 问答 \ Repository状态在JGit中合并(Repository state Merging in JGit)

Repository状态在JGit中合并(Repository state Merging in JGit)

我正在尝试以编程方式解决合并冲突,即强制合并。 解决合并冲突后,如果我尝试提交,我会得到下面的异常:

org.eclipse.jgit.api.errors.WrongRepositoryStateException:无法提交到状态为:MERGING的存储库。

如何更改存储库状态或缺少某些内容。 代码片段:

if((RepositoryState.SAFE == pullCommand.getRepository().getRepositoryState())) {
  PullResult result = pullCommand.call();
  if(MergeStatus.CONFLICTING == result.getMergeResult().getMergeStatus()){

     mgCmd = git.merge();
     mgCmd.include(repo.getRef("refs/remotes/origin/development"));
     mgCmd.setStrategy(MergeStrategy.OURS);
     mgCmd.setCommit(true);
     res = mgCmd.call(); 
     System.out.println("Failing Path ==="+res.getFailingPaths());
     pullCommand.getRepository().resolve("C:\\CODE\\thin\\thinclient\\.git");
     if(res.getMergeStatus().equals(MergeResult.MergeStatus.CONFLICTING)){
       System.out.println("Merge status=========+++"+res.getMergeStatus());
     }

I am trying to resolve the merge conflicts programmatically, i.e force merge. After resolving merge conflicts, if i try to commit i get the below exception:

org.eclipse.jgit.api.errors.WrongRepositoryStateException: Cannot commit into a repository with state: MERGING.

How do I change the repository status or am I missing something. Code snippet:

if((RepositoryState.SAFE == pullCommand.getRepository().getRepositoryState())) {
  PullResult result = pullCommand.call();
  if(MergeStatus.CONFLICTING == result.getMergeResult().getMergeStatus()){

     mgCmd = git.merge();
     mgCmd.include(repo.getRef("refs/remotes/origin/development"));
     mgCmd.setStrategy(MergeStrategy.OURS);
     mgCmd.setCommit(true);
     res = mgCmd.call(); 
     System.out.println("Failing Path ==="+res.getFailingPaths());
     pullCommand.getRepository().resolve("C:\\CODE\\thin\\thinclient\\.git");
     if(res.getMergeStatus().equals(MergeResult.MergeStatus.CONFLICTING)){
       System.out.println("Merge status=========+++"+res.getMergeStatus());
     }

原文:https://stackoverflow.com/questions/43254231
更新时间:2023-04-30 06:04

最满意答案

检查平面并行性可能是值得的。 如果你知道自己在做什么,就可以获得相当不错的性能,但为了获得出色的性能,有时需要阅读并检查核心输出,以了解为什么事物没有被拆箱。

不过,这取决于。 如果你正在编写绝对性能的C代码,那么你很可能不会用Repa来击败 C,因为别名分析目前看起来并不是很好。 但除非您将C代码手工融合到一个单一的函数中,否则我怀疑从融合中获得的好处以及Repa中的“自由并行”可能有助于它的竞争。

http://code.ouroborus.net/gloss/gloss-head/gloss-examples/raster/Ray/

http://www.youtube.com/watch?v=jBd9c1gAqWs

并且不要使用列表。 如果你不想使用Repa,我建议你使用Data.Vector.Unboxed。


It might be worth checking out Repa for flat parallelism. You can get pretty good performance if you know what you're doing, but to get great performance it can sometimes require reading and inspecting the core output to see why things aren't being unboxed.

It depends, though. If you're writing C code for absolute performance, you're most likely not going to beat C with Repa, because the alias analysis doesn't seem to be very good at the moment. But unless you're hand-fusing your C code into one monolithic function, I suspect the benefits you get from fusion and the 'free parallelism' in Repa might help it compete.

http://code.ouroborus.net/gloss/gloss-head/gloss-examples/raster/Ray/

http://www.youtube.com/watch?v=jBd9c1gAqWs

And don't use lists. If you don't want to use Repa, I suggest you use Data.Vector.Unboxed.

相关问答

更多
  • 你应该使用Phong-Bui Tong在1975年创建的Phong Shading方法.Phong方程将光照简化为三个部分:环境光,漫反射光和镜面光。 环境光是在完全黑暗中物体的照明。 环境照明不受光源影响。 漫射光是基于交叉点的表面法线与来自交叉点的光矢量之间的角度的光的亮度。 镜面光是我相信你正在寻找的。 它基于从相交角度到相机位置的矢量与关于表面的光矢量的反射矢量之间的角度。 以下是我通常使用Phong Shading的方法: 对于场景中的任何对象,定义三个常量:Ka(环境光),Kd(漫反射光)和Ks ...
  • 我开始这个小组是因为我对这种事感兴趣, http://groups.google.com/group/python-ray-tracing-community/web/list-of-python-statistical-ray-tracers 。 在这里,您将找到一个(非详尽的)python光线跟踪器列表,它应该指向正确的方向。 我还有一个用Python编写的光线跟踪器,它可以满足您的需求,但尚未发布! I started this group because I'm interested in this ...
  • 首先要做的是澄清你的代码。 1)您不需要以相反的顺序填充数组。 2)使用atan2 - 我没有得到你处理弧度的方式...... 3)缓存您将重用的数组元素。 4)不要在每种排序上创建一个排序函数。 5)如果按正确顺序排序,则无需按相反顺序显示。 一旦情况更清楚,我发现您使用字段3,5或6作为您的观点的y很奇怪。 我会说y数据只有一个偏移就够了;-) function sortByAngle(center) { for (var i = 0 ; i
  • 你拥有的是2D屏幕上的位置。 首先要做的就是将该点从像素转换为标准化的设备坐标 - -1到1.然后,您需要找到该点表示的3D空间中的线。 为此,您需要3D应用程序用于创建投影和相机的转换矩阵/ ces。 通常情况下,您有3个指标:投影,视图和模型。 当您为一个对象指定顶点时,它们位于“对象空间”中。 乘以模型矩阵给出“世界空间”中的顶点。 视图矩阵再次乘以“眼睛/相机空间”。 投影再次乘以“剪辑空间”。 剪辑空间具有非线性深度。 将Z分量添加到鼠标坐标将它们放入剪辑空间。 您可以在任何线性空间中执行线/对象 ...
  • 检查平面并行性可能是值得的。 如果你知道自己在做什么,就可以获得相当不错的性能,但为了获得出色的性能,有时需要阅读并检查核心输出,以了解为什么事物没有被拆箱。 不过,这取决于。 如果你正在编写绝对性能的C代码,那么你很可能不会用Repa来击败 C,因为别名分析目前看起来并不是很好。 但除非您将C代码手工融合到一个单一的函数中,否则我怀疑从融合中获得的好处以及Repa中的“自由并行”可能有助于它的竞争。 http://code.ouroborus.net/gloss/gloss-head/gloss-exam ...
  • 问题是,Haskell在诸如(+)和map类的纯函数和诸如putStrLn和main类的不纯操作之间有严格的区分。 当给定相同的输入并且不修改任何东西时,纯函数应该总是产生相同的结果。 这显然禁止使用PutStr和朋友。 类型系统实际上实施了这种分离。 每个执行IO或不以任何方式不纯的函数都会在其类型前面IO 。 TL;博士; 使用模块Debug.Trace trace : import Debug.Trace isPrime2 1 = False isPrime2 n = show n `trace` ...
  • 您可以通过为您的功能添加额外的效果来完成此操作; 即国家效应。 import Control.Monad.State printPath :: (PrintfArg t, Show a) => (t, a) -> IO () printPath (l, file) = printf "%d : %s\n" l (show file) traverseFlatDst :: Path Abs Dir -> IO () traverseFlatDst = let loop srcDir = do ...
  • 我发现http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtrace0.htm很有用。 它不会一直回到基础,但可能仍然有帮助(提示:如果你看到像我一样破碎的字体字符,它意味着是一个点积)。 I found http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtrace0.htm useful. It doesn't go all the way back ...
  • 鉴于您的左侧图像显示癌症 ,这是阴影射线击中被反射的物体的经典案例。 在对阴影射线进行击中测试时,您需要排除生成射线的表面。 只需将源对象传递给阴影函数,然后忽略它。 此方法仅适用于凸形。 如果你的形状有自阴影(例如圆环),你需要更加通用。 通常的方法是定义epsilon (浮点误差容差)并忽略任何比它更近的交叉点。 另一种方法是检测您击中的表面的哪一侧 。 你不应该在球体上自阴影,因为射线的投射方向与曲面法线相同( 即射出光线和曲面法线的点积为正) - 这不应算作阴影。 Given that your l ...
  • 除了编码时永远不会很好的硬编码常数之外,还有一个更微妙的问题,尽管你的图像整体看起来很好。 蒙特卡罗积分包括将被积函数除以生成这些样本的概率密度函数 (pdf)。 因此,您的代码中存在两个问题: 虽然你似乎已经使用了pdf for Phong模型(如果我认得它很好;至少它不是一个统一的pdf),你没有用pdf分 您已经进一步按比例缩放x和y分量1./16. 因为没有理由进一步改变你的pdf。 我们的想法是, 如果你能够根据Phong的模型和余弦定律完全采样你的光线,那么你甚至不必将你的被积函数乘以BRDF。 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)