做平行的阶段,最好的方法? [英] Best way to do parallel stages?

查看:189
本文介绍了做平行的阶段,最好的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在平行于阶段文件并提交到不同的分支同时

I want to stage files in parallel and commit into different branches concurrently.

有将在同一时间多路存取。该repo.Index.Stage / repo.Commit API工作在同一个当前目录,所以我觉得这是不可能的。

There will be multiple access at the same time. The repo.Index.Stage/repo.Commit API works on the same current directory so I think this is out of the question.

你们能不能给我一些提示上如何可能实现?一般的思路

Can you guys give me some tips on how this might be achievable? A general idea?

推荐答案

从可行性的角度来看,我能想到的两种不同的选择:

From a feasibility perspective, I can think of two different options:

考虑到并行阶段文件作为约束

字的分期在git的说法意味着使用索引。

The word "staging" in git parlance implies the use of the index.

在为阶段并行文件中,人们可以打开许多库的情况下,他们每个人接受不同的对的工作目录/索引。他们都创造了同一个对象的数据库对象。

In order to stage in files in parallel, one could open many repository instances, each of them accepting a different pair of Working Directory/Index. All of them creating objects in the same object database.

这可以实现得益于可选的 RepositoryOptions 参数在构造。

This can be achieved thanks to the optional RepositoryOptions parameter of the Repository constructor.

请参阅本这个测试 为了得到这是如何实现的是第一次看到。

See this this test in order to get a first glimpse at how this is achievable.

备选方案,准系统版

另一个选择是的不是的使用索引,并直接在对象数据库中创建对象。但是,这意味着什么是上演,那斑点,树木和承诺将不得不手工创建的。

Another option is to not use the index and create objects directly in the object database. However, this means that nothing would be "staged", and that Blobs, Trees and Commits would have to created by hand.

一个较低的水平API允许此类操作的。这个API甚至将允许一个的提交的针对纯仓库

A lower level API allows such kind of manipulations. This API would even allow one to "commit" against a bare repository.

看到 ObjectDatabaseFixture TreeDefinitionFixture 测试套件有关如何实现这一目标的详细信息。

See the ObjectDatabaseFixture and TreeDefinitionFixture test suites for more information about how to achieve this.

这API将只在数据库中创建对象。你将不得不自行更新的树枝尖。这样就可以实现感谢 Repo.Refs.Add() Repo.Refs.UpdateTarget()方法。

This API will only create objects in the database. You will have to update the tip of the branches by yourself. This can be achieved thanks to the Repo.Refs.Add() and Repo.Refs.UpdateTarget() methods.

这篇关于做平行的阶段,最好的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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