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

Re: [Administrivia] On ruby and contrib/

From
Duy Nguyen <pclouds@gmail.com>
Date
Jun 8, 2013, 11:28 UTC
Message-ID
<CACsJy8DTKr5Fy3-+8ShUrWQrKC2_7EmLHwyVgQ9Aq5JDOFBAqA@mail.gmail.com>
In-Reply-To
<CAMP44s08V1=nVbeo6r8UVT3Fd0=iSpRohinqf77Tmu4=xpDHeg@mail.gmail.com>

On Sat, Jun 8, 2013 at 5:02 PM, Felipe Contreras <felipe.contreras@gmail.com> wrote:

Show 28 quoted lines
> On Fri, Jun 7, 2013 at 9:17 PM, Duy Nguyen <pclouds@gmail.com> wrote:
>> On Thu, Jun 6, 2013 at 11:22 PM, Johannes Schindelin
>> <Johannes.Schindelin@gmx.de> wrote:
>>> Hi Greg,
>>>
>>> On Thu, 6 Jun 2013, Greg Troxel wrote:
>>>
>>>> As one of the people who helps maintain git packages in pkgsrc, my
>>>> initial reaction is negative to adding a ruby dependency.
>>>
>>> My initial reaction, too. It was hard enough to get Perl included with Git
>>> for Windows (because of that pesky Subversion dependency).
>>>
>>> As you can see from the commit history, I was the primary force behind
>>> trying to get everything "core" in Git away from requiring scripting
>>> languages (I think it is an awesome thing to provide APIs for as many
>>> languages as possible, but a not-so-cool thing to use more than one
>>> language in the core code). It does not seem that anybody picked up that
>>> task when I left, though.
>>
>> Nobody seems to mention it yet. There's another reason behind the C
>> rewrite effort: fork is costly on Windows. The C rewrite allows us to
>> run with one process (most of the time). This applies for shell, perl
>> and even ruby scripts because libgit.a is never meant to be used
>> outside git.c context (unlike libgit2). In this regard, ruby is just
>> as bad as currently supported non-C languages.
>
> Are you sure?

I'm not saying you can't. I'm saying it's not meant to be used that way. Which means there may be problems lurking around. You can write a ruby extension to access libgit.a, sure, but how many people on this list understand git design and limits _and_ ruby's good enough to spot the bugs? If a bug is found and requires major restructuring in libgit.a, how are you sure it's worth the effort and does not destablize the rest of git? A better way to do it is linking against libgit2.

Show 29 quoted lines
>
> ---
> #!/bin/sh
>
> cat > /tmp/test <<EOF
> require './git'
>
> (1..100).each do |e|
>   puts \`git rev-parse HEAD~#{e}\`
> end
> EOF
>
> strace -o /tmp/log -e fork,clone ruby /tmp/test
> cat /tmp/log
> ---
>
> ---
> clone(child_stack=0x7f84131dbff0,
> flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,
> parent_tidptr=0x7f84131dc9d0, tls=0x7f84131dc700,
> child_tidptr=0x7f84131dc9d0) = 17455
> +++ exited with 0 +++
> ---
>
> I wrote a simple Ruby extension to access Git builtins so `git
> rev-parse` actually calls cmd_rev_parse directly. I don't know of any
> other language that supports so much extensibility. Of course, as soon
> as one command does exit(), the script ends too. It could be useful to
> do experiments though.

-- Duy

Previous: Felipe ContrerasNext: Felipe Contreras
Message 67 of 104 in “What's cooking in git.git (Jun 2013, #02; Tue, 4)”
  1. Junio C HamanoJun 4, 2013
  2. [Administrivia] On ruby and contrib/Junio C Hamano, Jun 5, 2013
  3. David LangJun 5, 2013
  4. Felipe ContrerasJun 5, 2013
  5. Michael HaggertyJun 5, 2013
  6. Junio C HamanoJun 5, 2013
  7. Matthieu MoyJun 6, 2013
  8. Junio C HamanoJun 7, 2013
  9. Thomas Ferris NicolaisenJun 6, 2013
  10. Felipe ContrerasJun 5, 2013
  11. demerphqJun 6, 2013
  12. Felipe ContrerasJun 6, 2013
  13. Barry FishmanJun 6, 2013
  14. Felipe ContrerasJun 6, 2013
  15. Barry FishmanJun 6, 2013
  16. Felipe ContrerasJun 6, 2013
  17. Barry FishmanJun 6, 2013
  18. Felipe ContrerasJun 6, 2013
  19. Charles McGarveyJun 6, 2013
  20. Greg TroxelJun 6, 2013
  21. Felipe ContrerasJun 6, 2013
  22. David LangJun 6, 2013
  23. Felipe ContrerasJun 6, 2013
  24. Ramkumar RamachandraJun 6, 2013
  25. David LangJun 6, 2013
  26. Ramkumar RamachandraJun 7, 2013
  27. Junio C HamanoJun 7, 2013
  28. Ramkumar RamachandraJun 7, 2013
  29. Felipe ContrerasJun 7, 2013
  30. Ramkumar RamachandraJun 7, 2013
  31. Ramkumar RamachandraJun 7, 2013
  32. Johannes SchindelinJun 9, 2013
  33. Ramkumar RamachandraJun 9, 2013
  34. Junio C HamanoJun 9, 2013
  35. Felipe ContrerasJun 10, 2013
  36. Junio C HamanoJun 7, 2013
  37. Felipe ContrerasJun 7, 2013
  38. Duy NguyenJun 8, 2013
  39. Felipe ContrerasJun 8, 2013
  40. Duy NguyenJun 8, 2013
  41. Felipe ContrerasJun 8, 2013
  42. Felipe ContrerasJun 7, 2013
  43. Greg TroxelJun 6, 2013
  44. Felipe ContrerasJun 6, 2013
  45. Ramkumar RamachandraJun 6, 2013
  46. Dependencies and packaging (Re: [Administrivia] On ruby and contrib/)Jonathan Nieder, Jun 6, 2013
  47. Felipe ContrerasJun 7, 2013
  48. Johannes SchindelinJun 6, 2013
  49. Ramkumar RamachandraJun 6, 2013
  50. Johannes SchindelinJun 7, 2013
  51. Ramkumar RamachandraJun 7, 2013
  52. Matthieu MoyJun 7, 2013
  53. Ramkumar RamachandraJun 7, 2013
  54. Ramkumar RamachandraJun 7, 2013
  55. Matthieu MoyJun 7, 2013
  56. Ramkumar RamachandraJun 7, 2013
  57. Matthieu MoyJun 7, 2013
  58. Felipe ContrerasJun 7, 2013
  59. Jonathan NiederJun 7, 2013
  60. Matthew RuffaloJun 7, 2013
  61. Junio C HamanoJun 7, 2013
  62. Felipe ContrerasJun 7, 2013
  63. Ramkumar RamachandraJun 7, 2013
  64. Johannes SchindelinJun 9, 2013
  65. Duy NguyenJun 8, 2013
  66. Felipe ContrerasJun 8, 2013
  67. Duy NguyenJun 8, 2013
  68. Felipe ContrerasJun 8, 2013
  69. Duy NguyenJun 8, 2013
  70. Felipe ContrerasJun 8, 2013
  71. Jeff KingJun 8, 2013
  72. Felipe ContrerasJun 8, 2013
  73. Jeff KingJun 9, 2013
  74. Felipe ContrerasJun 9, 2013
  75. Jeff KingJun 9, 2013
  76. Felipe ContrerasJun 9, 2013
  77. Johannes SchindelinJun 9, 2013
  78. Johannes SixtJun 5, 2013
  79. Jeff KingJun 5, 2013
  80. t0005: skip signal death exit code test on WindowsJohannes Sixt, Jun 6, 2013
  81. Jeff KingJun 6, 2013
  82. Felipe ContrerasJun 6, 2013
  83. Jeff KingJun 6, 2013
  84. Felipe ContrerasJun 6, 2013
  85. Junio C HamanoJun 6, 2013
  86. Jeff KingJun 6, 2013
  87. Johannes SixtJun 7, 2013
  88. Erik Faye-LundJun 7, 2013
  89. Johannes SixtJun 7, 2013
  90. Erik Faye-LundJun 7, 2013
  91. Johannes SixtJun 7, 2013
  92. Erik Faye-LundJun 7, 2013
  93. Johannes SixtJun 7, 2013
  94. Erik Faye-LundJun 7, 2013
  95. mingw: make mingw_signal return the correct handlerJohannes Sixt, Jun 10, 2013
  96. Erik Faye-LundJun 10, 2013
  97. Junio C HamanoJun 10, 2013
  98. Jeff KingJun 9, 2013
  99. Junio C HamanoJun 9, 2013
  100. Johannes SixtJun 10, 2013
  101. Erik Faye-LundJun 10, 2013
  102. Felipe ContrerasJun 6, 2013
  103. Erik Faye-LundJun 7, 2013
  104. Erik Faye-LundJun 7, 2013

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.