哪种语言具有最佳的Git API绑定? [英] Which language has the best Git API Bindings?

查看:135
本文介绍了哪种语言具有最佳的Git API绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待在建设有重关系到Git的应用程序。

I am looking at building an application with heavy ties to git..

是否有语言绑定可用,如果是这样,这是最COM prehensive?

Are there language bindings available and if so which are the most comprehensive?

难道意味着要裸机C 3

Would it mean going to Bare Metal C?

抑或是的Perl / Python的/ PHP / C#有一组完整的绑定?

Or does perl / python / php / C# have a set of full bindings?

感谢

丹尼尔

推荐答案

有三种不同的方法相对于使用Git从某种编程语言中的:

There are three different approaches with respect to using Git from within some programming language:


  • 重新实现在不同语言的Git 。这就是下面的项目做的:

  • Reimplementation of Git in different language. That is what the following projects do:


  • JGit 这是Java的Git重新实现(通过的EGit Eclipse的 Git的插件,和的格里特code审查

  • 砂砾 是Ruby库在面向对象的方式从一个Gi​​t仓库中提取信息,其中包括一个的部分的本地Ruby实现。例如使用通过GitHub上。

  • GitSharp 这是在C#.NET和单声道的Git remplemantation,并且这是继JGit WRT。功能

  • 德威这是Git的文件格式和协议纯Python读写的实现。

  • 的Git :: PurePerl 是纯Perl接口Git仓库(这是主要是基于砂,最初)。

  • GLIP 是在PHP中的git库 - 纯PHP实现。其作者为eWiki使用。

  • 由MonoDevelop的使用JGit的NGit .NET端口

  • JGit which is reimplementation of Git in Java (used among others by EGit, the Eclipse Git plugin, and Gerrit Code Review),
  • Grit is Ruby library for extracting information from a git repository in an object oriented manner, which includes a partial native Ruby implementation. Used e.g. by GitHub.
  • GitSharp which is remplemantation of Git in C# for .NET and Mono, and which is following JGit wrt. functionality,
  • Dulwich which is pure-Python read-write implementation of the Git file formats and protocols.
  • Git::PurePerl is pure Perl interface to Git repositories (it was mostly based on Grit, initially).
  • Glip is "git library in PHP" - pure PHP implementation. Used by its author for eWiki.
  • NGit .NET port of JGit used by Monodevelop

酒店与重新实现的问题是,他们并不始终贯彻的全部功能,而且有时实施错了。在另一方面,他们都是本地人,实现良好的性能;他们可能不同于C(原件)实施的Git,这是在GPLv2许可。


The problem with reimplementations is that they do not always implement the full functionality, and sometimes implement it wrong. On the other hand they are native, implement good performance; they may be licensed differently than C (original) implementation of Git, which is GPLv2.

封装器这称之为Git命令,敷在某种结果呢,适当的目标语言。

Wrappers which call Git commands and wrap result it in some kind, suitably for target language.

  • The Git.pm module distributed with git (and used by some of its commands), Git::Wrapper and Git::Repository wrap git commands for Perl.
  • JavaGit is a Java API that provides access to git repositories via calling git commands.
  • GitPython is a Python library used to interact with Git repositories, by calling the Git executables and parsing output.
  • hs-libgit is Haskell wrapper for git.

结果,与包装器的问题是,它们可能是缓慢的(它们需要分叉一个git的处理),并且,它们需要的git要安装工作。


The problem with wrappers is that they can be slow (they require forking a git process), and that they require git to be installed to work.

还要注意的git本身是高度可脚本(例如使用shell脚本),这要归功于一个事实,即旁更高级别的命令意味着最终用户(的),它也提供了意味着脚本低级别的命令(管道的)。结果

Note also that git itself is highly scriptable (e.g. using shell scripts), thanks to the fact that beside higher level commands meant for end user (porcelain) it also provides low level commands meant for scripting (plumbing).

最后,还有绑定libgit2 ,这意味着将重入链接库具有扎实的API(是code 2010项目的谷歌夏季)。

Finally there are bindings to libgit2, which means to be re-entrant linkable library with a solid API (was Google Summer of Code 2010 project).

  • libgit2 itself is a portable, pure C implementation.
  • Rugged - Ruby bindings.
  • php-git - PHP bindings.
  • luagit2 - Lua bindings.
  • GitForDelphi - Delphi bindings.
  • libgit2sharp - .NET bindings.
  • pygit2 - Python bindings.
  • Geef is a simple Erlang NIF that exposes some of the libgit2 library functions to Erlang. Monodevelop uses a .NET port for JGit

结果Libgit2是相当新的项目;这是正在进行的工作,所以不是一切都在暂且执行。请参见 libgit2首页的详细资料。结果


Libgit2 is quite new project; it is work in progress, so not everything is implemented at the time of being. See libgit2 homepage for details.

所有这些信息可以在<一个发现href=\"https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools\">InterfacesFrontendsAndTools对Git的Wiki页面

All this information can be found at InterfacesFrontendsAndTools page on Git Wiki

这篇关于哪种语言具有最佳的Git API绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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