14

Now before you shoot me for bringing up a duplicate question on SOF, let me first acquaint you with exactly what I'm looking for, and I will address other questions and answers and why it is insufficient.

Question #1:

I'm looking for a way to perform live collaborative edits, while the source is maintained on a centralized source control server. For example, if Me and Joe Blow are editing file X.cs at the same time, we should be able to see each-other's edits as we type. Almost as if we were sitting together at the same computer. Now take the following scenario: Me and Joe go offline, and Nimha Smith decides she wants to update some code. When I come back online the following day, I get pushed the code that Nimha updated while I was sleeping/away from the server.

This is a combination of the idea of live collaboration, and a source control system like SVN, etc.

Addressing of the possible duplicates:

There was a similar question, here: Collaborative editing for .NET development - what are the possibilities, however it does not give me anything useful and I'll explain why:

  • VsAnywhere: It runs through a central public server (right direction..?) except all parties involved need to have the exact same code on their machine before joining a session, and once you go offline the session is destroyed.
  • SourceMeet: Runs with a P2P system, so no server to keep track of changes while offline etc. Have not tried it, so I can not attest to how well it can merge code (if it can at all)
  • CollabEdit: Not VisualStudio
  • Cloud 9: Not VisualStudio

And there is obviously this question and this one that are questions directly about source control software such as SVN or GIT. Now, I tried to get VSAnywhere and SVN to play nice together, (SVN for getting changes made while offline, and VSAnywhere for the online developers) but it simply does not work.

<edit>

I recently found this bachelor thesis project named Collab, and it seems like a good idea, but I could not seem to get it working to try it. If anyone else has any success with it please let me know what you did. It looks like if I can get this collab project working it seems like it would be a good start into creating something to fit my needs.

<edit2>

I've also come across BeWeeVee which had a Visual Studio extension for it's service, but all the links for it have gone dead. And CodeALike which was probably their replacement for VS real-time collaboration has a FAQ entry explaining that it's real-time features have been removed and will be re-implemented in the "future".

Question #2:

Now this brings me to the second part of my question because I fully realise there may not be a program out there that fits my tall order. Where could I start implementing software such as this myself? Are there some existing open-source source-control / real-time editing code that I can begin to build off of to create this? Or am I pretty much stuck starting from scratch if I want to implement this. And I'm sure you can see by the tags that I would like to tackle a task like this in C#, if I have to tackle it at all.

Update 2017

As there has been some continued interest expressed in the comments I've created a gitter where we can gather anyone interested and potentially make this a reality: https://gitter.im/sof-centrailized-collab-editing/Lobby.

4

3 回答 3

3

如果您想自己解决这个问题,您可能希望将其作为 Visual Studio 扩展来完成。请注意,有两种不同类型的插件:“附加组件”和“扩展”。我个人认为你应该编写一个extension,但无论哪种方式,你都可以用 C# 编写它们。

您需要连接到 Visual Studio 的文本编辑器。您可以通过谷歌搜索如何执行此操作,或者只查看现有示例:弹性制表位的 Visual Studio 扩展。您的扩展程序必须在您进行更改时监控您的更改,然后通过您设计的某种协议将它们发送到服务器。您必须自己编写服务器,但在第一个版本中,它所要做的就是将您的编辑发送给使用该扩展的其他所有人。然后,该扩展程序将使每个人都在其他人的编辑器中进行编辑。

如果有人使用旧版本的代码连接到服务器,则扩展程序可以从服务器下载最新版本。但是,如果用户在离线时(即未连接到服务器时)进行了编辑,那么您将需要进行一些巧妙的合并。这不是微不足道的,但我知道该怎么做,因为我以前做过。如果你问得很好,我会为你写合并算法。然后,您只需为其提供三个文本文件:基本文件(上次与服务器同步的版本)和两个编辑的版本(一个离线编辑的和服务器的最新版本)。

如果你设法让它发挥作用,你可能会创造出非常有用的东西。请务必宣传您的作品!:)

于 2012-06-06T19:11:40.637 回答
2

好吧,Google Wave 已经完成了查看其他人输入内容然后在编辑器中与他们进行光标大战的操作。Iirc 在项目本身失败后,它被作为开源或其他东西推出。不过,它确实可以解决您所有的更新问题,并且建立在从计算机科学角度来看非常强大和可靠的底层更新模型之上。它提供历史和各种类似于源代码系统的东西。

您可以在此之上实现您想要的特殊编辑小部件。如果您做得好,您可以让 Google Wave 成为一个有用且用途广泛的协作编辑平台。

于 2012-05-24T00:07:48.843 回答
1

关于 VS Anywhere,可能在您尝试 VSA 时(大约 5 月),软件版本是 Release Candidate 2(=buggy),因此您发现 SVN 集成存在一些问题以及 TFS 和 Git 存在未解决问题是正常的.

目前,在最新的 RC3 上,其中一些 SVN 问题已得到解决,我们希望很快为最终版本做好一切准备

有可能在您的 LAN 中运行您自己的 VS Anywhere 服务器实例,因此您真的不需要使用我们的公共服务器,如果您是学生或者您有开源项目,VS Anywhere 客户端和服务器对您是免费的,如果不是用于商业用途,您应该支付少量费用。

正如 Timwi 所说,从离线编码重新同步是不平凡的,并且实现起来非常复杂,我们认为 SCM 是完成这项工作的正确工具,这是因为我们还没有朝这个方向工作,我们的意见至少在我们之前在这方面工作,您可以在设置会话之前使用标准 SCM 提取最新更改并与本地副本合并

VSA 将简化引导会话的过程,允许您 1) 检查与远程 Visual Studio 副本的差异,以及 2) 如果有的话,在打开会话时将它们合并到本地副本中以处于正确状态。(“1)”实现“2)”即将到来)

会话管理不是微不足道而且非常复杂的东西,有很多可能的场景,这是因为我们在完成时清理了会话,但是您可以随时单击重新开始会话......

希望这些信息对您有所帮助,如果您有更多问题,请随时联系 VS Anywhere 支持

关于如果您想开始一个项目来实现这样的插件,我们可以为您提供有关如何做事的信息,一个很好的起点是了解操作转换,因为您将需要这种方法来实现并发编辑,您还需要 P2P 或客户端/服务器协议,用于在客户端之间传输数据。

于 2012-06-28T21:47:47.077 回答