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

Re: [PATCH] fmt-merge-msg: avoid open "-|" list form for Perl 5.6

From
Linus Torvalds <torvalds@osdl.org>
Date
Feb 23, 2006, 19:51 UTC
Message-ID
<Pine.LNX.4.64.0602231143290.3771@g5.osdl.org>
In-Reply-To
<7virr5hnw4.fsf@assigned-by-dhcp.cox.net>
On Thu, 23 Feb 2006, Junio C Hamano wrote:
Show 8 quoted lines
>
> Linus Torvalds <torvalds@osdl.org> writes: 
> > There are many portable interpreters out there, and I don't mean perl. And 
> > writing a small "specialized for git" one isn't even that hard. In fact, 
> > most of the shell (and bash) hackery we do now would be unnecessary if we 
> > just made a small "git interpreter" that ran "git scripts".
> 
> Before anybody mentions tcl ;-).

Well, I was thinking more of the "embeddable" ones - things that are so small that they can be compiled with the project. Things like Lua.

Now, Lua is not really very useful for this use case: our scripts are much more about combining other programs - piping the output from one to the other - than about any traditional scripting. Which, afaik, Lua isn't good at.

Show 8 quoted lines
> I agree with the above in principle, but I am afraid that is
> only half of the solution to the problem Alex is having.
> 
> In the longer term, libified git with script language bindings
> would make the way git things work together a lot better.  I've
> always wanted to make merge-base a subroutine callable from
> other things, so that I can say "git diff A...B" to mean "diff
> up to B since B forked from A" ;-).

Yeah, we should libify some of it, to make things easier. That said, I don't belive in the "big-picture" libification. The fact is, a lot of git really _is_ about piping things from one part to another, and library interfaces work horribly badly for that. You really want more of a "stream" interface, and that's just not something I see happening.

I think one of the strengths of git is that you can use it in a very traditional UNIX manner, and do your own pipelines. And that will obviously NEVER work well under Windows, if only because it's not the natural way to do things.

Again, libification does nothing for that thing.

What I'd suggest using an embedded interpreter for is literally just the common helper scripts. We'll never make

	git-rev-list --header a..b -- tree | 
		grep -z '^author.*torvalds' |
		..

style interesting power-user pipelines work in windows, but we _can_ make the things like "git commit" work natively in windows without having to re-write it in C by just having an embedded interpreter.

And I very much mean _embedded_. Otherwise we'll just have all the same problems with perl and bash and versioning.

Show 5 quoted lines
> But we do need to talk to non-git things.  git-grep needs a way
> for ls-files to drive xargs/grep, for example.  diff --cc reads
> from GNU diff output.  And for these external tools, the way
> they expect the input to be fed to them or their output is taken
> out is via UNIXy pipe.

I was really thinking more of a simple shell-like script interpreter. Something that we can make portable, by virtue of it _not_ being real shell. For example, the "find | xargs" stuff we do is really not that hard to do portably even on windows using standard C, it's just that you can't do it THAT WAY portably without assuming that it's a full cygwin thing.

		Linus
Previous: Johannes SchindelinNext: Sam Vilain
Message 38 of 68 in “Should we support Perl 5.6?”
  1. Johannes SchindelinFeb 20, 2006
  2. Eric WongFeb 20, 2006
  3. Andreas EricssonFeb 20, 2006
  4. Junio C HamanoFeb 20, 2006
  5. fmt-merge-msg: avoid open "-|" list form for Perl 5.6Junio C Hamano, Feb 20, 2006
  6. rerere: avoid open "-|" list form for Perl 5.6Junio C Hamano, Feb 20, 2006
  7. send-email: avoid open "-|" list form for Perl 5.6Junio C Hamano, Feb 20, 2006
  8. svmimport: avoid open "-|" list form for Perl 5.6Junio C Hamano, Feb 20, 2006
  9. cvsimport: avoid open "-|" list form for Perl 5.6Junio C Hamano, Feb 20, 2006
  10. Alex RiesenFeb 21, 2006
  11. Sam VilainFeb 21, 2006
  12. Alex RiesenFeb 21, 2006
  13. Johannes SchindelinFeb 21, 2006
  14. Eric WongFeb 21, 2006
  15. Shawn PearceFeb 21, 2006
  16. Martin LanghoffFeb 21, 2006
  17. Sam VilainFeb 21, 2006
  18. Alex RiesenFeb 22, 2006
  19. Johannes SchindelinFeb 22, 2006
  20. Sam VilainFeb 22, 2006
  21. Junio C HamanoFeb 22, 2006
  22. Johannes SchindelinFeb 22, 2006
  23. Junio C HamanoFeb 22, 2006
  24. Alex RiesenFeb 23, 2006
  25. Junio C HamanoFeb 23, 2006
  26. Alex RiesenFeb 23, 2006
  27. Alex RiesenFeb 23, 2006
  28. Andreas EricssonFeb 23, 2006
  29. Alex RiesenFeb 23, 2006
  30. Andreas EricssonFeb 23, 2006
  31. Alex RiesenFeb 23, 2006
  32. Andreas EricssonFeb 23, 2006
  33. Linus TorvaldsFeb 23, 2006
  34. Junio C HamanoFeb 23, 2006
  35. Johannes SchindelinFeb 23, 2006
  36. Linus TorvaldsFeb 23, 2006
  37. Johannes SchindelinFeb 23, 2006
  38. Linus TorvaldsFeb 23, 2006
  39. Sam VilainFeb 23, 2006
  40. Linus TorvaldsFeb 24, 2006
  41. Alex RiesenFeb 23, 2006
  42. Christopher FaylorFeb 26, 2006
  43. Linus TorvaldsFeb 26, 2006
  44. Christopher FaylorFeb 26, 2006
  45. Alex RiesenMar 2, 2006
  46. Mark WoodingMar 2, 2006
  47. Alex RiesenMar 2, 2006
  48. Christopher FaylorMar 2, 2006
  49. Alex RiesenMar 2, 2006
  50. NT directory traversal speed on 25K files on CygwinRutger Nijlunsing, Feb 26, 2006
  51. Christopher FaylorFeb 27, 2006
  52. Rutger NijlunsingFeb 27, 2006
  53. Christopher FaylorFeb 27, 2006
  54. Andreas EricssonFeb 27, 2006
  55. Rutger NijlunsingFeb 27, 2006
  56. Alex RiesenMar 2, 2006
  57. Alex RiesenMar 2, 2006
  58. Christopher FaylorMar 2, 2006
  59. Alex RiesenMar 2, 2006
  60. Andreas EricssonMar 2, 2006
  61. Alex RiesenMar 2, 2006
  62. Christopher FaylorFeb 26, 2006
  63. Eric WongFeb 24, 2006
  64. Johannes SchindelinFeb 24, 2006
  65. Linus TorvaldsFeb 24, 2006
  66. Eric WongFeb 21, 2006
  67. Alex RiesenFeb 21, 2006
  68. Ron ParkerFeb 21, 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.