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

Re: Git 1.3.2 on Solaris

From
Linus Torvalds <torvalds@osdl.org>
Date
May 17, 2006, 02:20 UTC
Message-ID
<Pine.LNX.4.64.0605161904260.16475@g5.osdl.org>
In-Reply-To
<f3d7535d0605161652n3b2ec033r874336082755e728@mail.gmail.com>
[ Junio - see the "grep" issue ]
On Wed, 17 May 2006, Stefan Pfetzing wrote:
Show 6 quoted lines
> 
> So there are 2 possible solutions to get git working on Solaris.
> 
> 1.  fix every single shellscript automatically during the build phase
> 2.  setup a dir which contains symlinks to the "right" binaries and
> put that dir into PATH.
If the biggest issue is git depending on some GNU extensions, I'd really 
suggest
 (a) install all the normal GNU binaries, and put them in the path before 
     git just to get it working (and don't try to change git at all)
 (b) help send in patches that just remove the dependency entirely.

I've been - on and off - trying to libify most of the core git sources, so that the shell scripts can be re-written to be just plain C. Most of the time it's not actually even a huge amount of work, it's just somewhat boring.

Writing them as C usually gets rid of any dependencies on any GNU tools, and hopefully even cygwin. For example, we got rid of one "xargs -0" in the development branch pretty recently, thanks to making "git grep" a built-in.

Of course, I don't think anybody tried the new "git grep" on Solaris, and I think the solaris "grep" lacks the "-H" flag, for example. But that should be easy to fix (for example, replace the use of "--" and "-H" with putting a "/dev/null" as the first filename).

I don't think it's worth it trying to add some compatibility layer for the shell-scripts. We really do want to get rid of them, and the more people that help, the merrier.

In many ways, the libification effort isn't even needed. It's perfectly ok to turn a stupid shell-script (and they really all _are_ pretty stupid) into a builtin-cmd.c C file that just does something really easy like a "fork + execve()" translation of the original shell script.

The complete libification will take some time, and in the meantime, a few silly C files that hard-code the shell logic is probably much preferable to using the shell and all the problems that involves (like the whole problem with quoting arguments - just _gone_ when you do it as a execve() in a simple C program).

So anybody can help with this. If you know shell (and the git shell-scripts aren't even _advanced_ shell), and know some basic C, you're all set to do a trivial conversion from one to the other. And when the libification gets further, your conversion will probably help that (ie maybe libificaiton isn't complete, but a _part_ of the thing can be written to use the library interfaces instead of spawning an external program).

There aren't _that_ many shell programs, and a lot of them are really really trivial (ie they parse the arguments, and then do just a couple of external git commands).

			Linus
Previous: Jason RiedyNext: Jason Riedy
Message 3 of 36 in “Git 1.3.2 on Solaris”
  1. Stefan PfetzingMay 16, 2006
  2. Jason RiedyMay 17, 2006
  3. Linus TorvaldsMay 17, 2006
  4. Jason RiedyMay 17, 2006
  5. Linus TorvaldsMay 17, 2006
  6. Stefan PfetzingMay 17, 2006
  7. Linus TorvaldsMay 17, 2006
  8. Stefan PfetzingMay 17, 2006
  9. Linus TorvaldsMay 17, 2006
  10. Jason RiedyMay 17, 2006
  11. Stefan PfetzingMay 23, 2006
  12. Jason RiedyMay 23, 2006
  13. Stefan PfetzingMay 23, 2006
  14. Linus TorvaldsMay 23, 2006
  15. Edgar ToernigMay 23, 2006
  16. Linus TorvaldsMay 23, 2006
  17. Edgar ToernigMay 23, 2006
  18. Jason RiedyMay 23, 2006
  19. Linus TorvaldsMay 23, 2006
  20. Linus TorvaldsMay 23, 2006
  21. Stefan PfetzingMay 26, 2006
  22. Ryan AndersonMay 17, 2006
  23. Junio C HamanoMay 17, 2006
  24. Junio C HamanoMay 17, 2006
  25. builtin-grep: workaround for non GNU grep.Junio C Hamano, May 17, 2006
  26. Linus TorvaldsMay 17, 2006
  27. Junio C HamanoMay 17, 2006
  28. Bertrand JacquinMay 17, 2006
  29. Junio C HamanoMay 17, 2006
  30. Linus TorvaldsMay 17, 2006
  31. Junio C HamanoMay 17, 2006
  32. Linus TorvaldsMay 17, 2006
  33. Junio C HamanoMay 17, 2006
  34. Stefan PfetzingMay 17, 2006
  35. Junio C HamanoMay 17, 2006
  36. Stefan PfetzingMay 17, 2006

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.