Strategies for calling subversion in a Go program?

agolangf · · 635 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m trying to write a tool that among many tasks other features needs to query Subversion for file history. I haven&#39;t found a binding library for Go. Does one library exist? I could always fork an svn process but I was hoping for a cleaner solution. Next fall back would be Subversion&#39;s C API but I have no experience with cgo. </p> <hr/>**评论:**<br/><br/>kardianos: <pre><p>I would just exec svn and ask for xml output. But it may depend on your specific use case.</p></pre>egonelbre: <pre><p>Quickly stripped from an internal program using forking <a href="https://play.golang.org/p/p4dUlOV5ml" rel="nofollow">https://play.golang.org/p/p4dUlOV5ml</a> ... (may need some fixes for the imports and may have made a mistake while extracting the relevant pieces.)</p> <p>There are some bindings <a href="https://godoc.org/?q=svn" rel="nofollow">https://godoc.org/?q=svn</a>, but not clue how well they work.</p></pre>weberc2: <pre><p>The only options I&#39;m aware of are to do the querying in a different SVN process (either call into SVN directly or call into an SVN daemon if such a thing exists), CGo, or writing your own SVN implementation in Go.</p></pre>croninsiglos: <pre><p>This first thing I would do is convert the subversion repo to git via a tool like svn2git to keep the history... then I&#39;d use git :)</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

635 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传