git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Python extension commands in git - request for policy change

From
Jeff King <peff@peff.net>
Date
Dec 12, 2012, 08:32 UTC
Message-ID
<20121212083210.GB18322@sigill.intra.peff.net>
In-Reply-To
<CACh33FrgZhsKp7o9ki6n1AbfRKYYbdLMWuGUGKUqDfH5m0Akng@mail.gmail.com>
On Wed, Dec 12, 2012 at 02:03:56AM -0500, Patrick Donnelly wrote:
Show 11 quoted lines
> On Wed, Dec 12, 2012 at 1:32 AM, Jeff King <peff@peff.net> wrote:
> > It would take a lot of effort to expose git-core's internals in a clean
> > way; you'd probably be better off starting from scratch and rewriting
> > large parts in a friendly library-like manner. Fortunately, there is
> > already a project underway to do so: libgit2.  It does not yet have
> > feature parity with git, but it can do quite a bit.  And there are
> > already ruby and python bindings.
> 
> Of course, this comes back to the issue of whether it's a good idea to
> use perl/ruby/python as a front-end to regular git commands
> (pull/push/etc.).

Yeah, I think that is a separate issue, though. I cannot see us ever writing core commands like "git pull" in any scripting language besides POSIX shell due to dependency issues. So language bindings are really for things that are not going to go into git-core, or are ancillary commands that people can live without (e.g., git-add--interactive, remote helpers, etc).

> While, yes, bindings can be made for these languages, you are now
> making git depend on the presence of one of these languages in order
> for git to function. With Lua, the (static) dependence is very small
> yet brings much to git in terms of extensibility and maintainability.

And I would include Lua in my list of "I cannot see..." above. It can be statically linked, so it is not a run-time dependency, but it would still be a build-time dependency. The community has historically been pretty resistant to dependencies (I do not care too much myself, though).

I think doing anything significant in Lua would have the same problem as doing anything significant in Python: there would need to be substantial internal cleanup to make sane bindings. And again, that is what libgit2 is doing (and yes, there are Lua bindings for it already).

Using libgit2 bindings would introduce a new dependency, of course, but that is on par with a Lua dependency.

> As for Lua's suitability for your (2) point, I admit I'm not familiar
> with how much "interacting with the outside world" the git commands
> do; however, I would suspect that it is not significant enough to rule
> Lua out?

I did not mean to rule it out for point (2); I only meant that it is probably the only reasonable thing for point (1), whereas for point (2), we have many more options. I suspect Lua would do just fine given the right set of modules, though I tend to prefer other languages myself when embeddedness is not an issue.

As for "interacting with the outside world", I was specifically thinking of stuff like git-send-email (currently in perl) and git-imap-send (written in C). They need to open network sockets and speak standard protocols. I suspect Lua would need a module or custom bindings to do the former at all, and certainly the code would be much simpler if we re-used standard modules for speaking SMTP and IMAP (which of course increases our dependencies again...).

-Peff
Previous: Patrick DonnellyNext: Eric S. Raymond
Message 48 of 82 in “Python extension commands in git - request for policy change”
  1. Eric S. RaymondNov 25, 2012
  2. Nguyen Thai Ngoc DuyNov 25, 2012
  3. Eric S. RaymondNov 25, 2012
  4. Felipe ContrerasNov 25, 2012
  5. Eric S. RaymondNov 25, 2012
  6. Felipe ContrerasNov 25, 2012
  7. Eric S. RaymondNov 25, 2012
  8. Felipe ContrerasNov 25, 2012
  9. Eric S. RaymondNov 25, 2012
  10. Felipe ContrerasNov 26, 2012
  11. David AguilarNov 27, 2012
  12. Felipe ContrerasNov 27, 2012
  13. Sitaram ChamartyNov 27, 2012
  14. David AguilarNov 27, 2012
  15. Guillaume DE BURENov 27, 2012
  16. Johannes SchindelinNov 27, 2012
  17. Felipe ContrerasNov 28, 2012
  18. Johannes SchindelinNov 25, 2012
  19. Pat ThoytsNov 25, 2012
  20. Eric S. RaymondNov 25, 2012
  21. Erik Faye-LundNov 25, 2012
  22. Felipe ContrerasNov 25, 2012
  23. Eric S. RaymondNov 25, 2012
  24. Felipe ContrerasNov 25, 2012
  25. Eric S. RaymondNov 25, 2012
  26. Felipe ContrerasNov 25, 2012
  27. Eric S. RaymondNov 25, 2012
  28. Andreas EricssonNov 26, 2012
  29. Michael HaggertyNov 25, 2012
  30. Eric S. RaymondNov 25, 2012
  31. David LangNov 25, 2012
  32. Stefano LattariniNov 25, 2012
  33. Eric S. RaymondNov 25, 2012
  34. Nguyen Thai Ngoc DuyNov 25, 2012
  35. Patrick DonnellyDec 11, 2012
  36. Sitaram ChamartyDec 12, 2012
  37. Patrick DonnellyDec 12, 2012
  38. Tomas CarneckyDec 12, 2012
  39. Nguyen Thai Ngoc DuyDec 12, 2012
  40. Tomas CarneckyDec 12, 2012
  41. Patrick DonnellyDec 12, 2012
  42. Joshua JensenDec 12, 2012
  43. Eric S. RaymondDec 12, 2012
  44. Joshua JensenDec 12, 2012
  45. Eric S. RaymondDec 12, 2012
  46. Jeff KingDec 12, 2012
  47. Patrick DonnellyDec 12, 2012
  48. Jeff KingDec 12, 2012
  49. Eric S. RaymondDec 12, 2012
  50. Jeff KingDec 12, 2012
  51. Junio C HamanoDec 12, 2012
  52. Andrew ArdillDec 12, 2012
  53. Junio C HamanoDec 12, 2012
  54. Patrick DonnellyDec 12, 2012
  55. Eric S. RaymondDec 12, 2012
  56. Patrick DonnellyDec 19, 2012
  57. Felipe ContrerasNov 25, 2012
  58. Eric S. RaymondNov 25, 2012
  59. Felipe ContrerasNov 25, 2012
  60. Eric S. RaymondNov 25, 2012
  61. Felipe ContrerasNov 26, 2012
  62. Magnus BäckNov 27, 2012
  63. Eric S. RaymondNov 27, 2012
  64. Sitaram ChamartyNov 27, 2012
  65. Felipe ContrerasNov 28, 2012
  66. Philippe VaucherDec 3, 2012
  67. Felipe ContrerasDec 4, 2012
  68. Stephen BashDec 4, 2012
  69. Felipe ContrerasNov 28, 2012
  70. Jeff KingNov 28, 2012
  71. Felipe ContrerasNov 28, 2012
  72. Jeff KingNov 28, 2012
  73. Felipe ContrerasNov 28, 2012
  74. Magnus BäckNov 28, 2012
  75. Joshua JensenNov 28, 2012
  76. Johannes SixtNov 25, 2012
  77. Eric S. RaymondNov 25, 2012
  78. Krzysztof MazurNov 25, 2012
  79. Eric S. RaymondNov 25, 2012
  80. Sitaram ChamartyNov 26, 2012
  81. Krzysztof MazurNov 26, 2012
  82. Martin LanghoffDec 4, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.