git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] fmt-merge-msg: avoid open "-|" list form for Perl 5.6
Date: Thu, 23 Feb 2006 11:51:43 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0602231143290.3771@g5.osdl.org> (raw)
In-Reply-To: <7virr5hnw4.fsf@assigned-by-dhcp.cox.net>



On Thu, 23 Feb 2006, Junio C Hamano wrote:
>
> 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.

> 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. 

> 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

  parent reply	other threads:[~2006-02-23 19:52 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-20 18:37 Should we support Perl 5.6? Johannes Schindelin
2006-02-20 19:10 ` Eric Wong
2006-02-20 21:01   ` Andreas Ericsson
2006-02-20 21:15     ` Junio C Hamano
2006-02-20 22:05   ` [PATCH] fmt-merge-msg: avoid open "-|" list form for Perl 5.6 Junio C Hamano
2006-02-20 22:12     ` [PATCH] rerere: " Junio C Hamano
2006-02-20 22:12     ` [PATCH] send-email: " Junio C Hamano
2006-02-20 22:12     ` [PATCH] svmimport: " Junio C Hamano
2006-02-20 22:19     ` [PATCH] cvsimport: " Junio C Hamano
2006-02-21 17:30     ` [PATCH] fmt-merge-msg: " Alex Riesen
2006-02-21 20:36       ` Sam Vilain
2006-02-21 21:57         ` Alex Riesen
2006-02-21 22:19           ` Johannes Schindelin
2006-02-21 22:35             ` Eric Wong
2006-02-21 22:38             ` Shawn Pearce
2006-02-21 23:00             ` Martin Langhoff
2006-02-21 22:38           ` Sam Vilain
2006-02-22 16:35             ` Alex Riesen
2006-02-22 19:44               ` Johannes Schindelin
2006-02-22 19:51               ` Sam Vilain
2006-02-22 19:54                 ` Junio C Hamano
2006-02-22 22:00               ` Johannes Schindelin
2006-02-22 22:25                 ` Junio C Hamano
2006-02-23  8:00                 ` Alex Riesen
2006-02-23  8:45                   ` Junio C Hamano
2006-02-23  9:35                     ` Alex Riesen
2006-02-23  9:41                       ` Alex Riesen
2006-02-23  9:48                         ` Andreas Ericsson
2006-02-23 10:10                           ` Alex Riesen
2006-02-23 13:29                             ` Andreas Ericsson
2006-02-23 14:07                               ` Alex Riesen
2006-02-23 14:22                                 ` Andreas Ericsson
2006-02-23 17:13                                 ` Linus Torvalds
2006-02-23 19:32                                   ` Junio C Hamano
2006-02-23 19:38                                     ` Johannes Schindelin
2006-02-23 19:54                                       ` Linus Torvalds
2006-02-23 20:19                                         ` Johannes Schindelin
2006-02-23 19:51                                     ` Linus Torvalds [this message]
2006-02-23 20:31                                       ` Sam Vilain
2006-02-24  6:43                                         ` Linus Torvalds
2006-02-23 21:43                                   ` Alex Riesen
2006-02-26 19:55                                 ` Christopher Faylor
2006-02-26 20:18                                   ` Linus Torvalds
2006-02-26 20:40                                     ` Christopher Faylor
2006-03-02 14:18                                       ` Alex Riesen
2006-03-02 15:18                                         ` Mark Wooding
2006-03-02 16:11                                           ` Alex Riesen
2006-03-02 15:22                                         ` Christopher Faylor
2006-03-02 16:20                                           ` Alex Riesen
2006-02-26 23:17                                   ` NT directory traversal speed on 25K files on Cygwin Rutger Nijlunsing
2006-02-27  1:18                                     ` Christopher Faylor
2006-02-27 18:30                                       ` Rutger Nijlunsing
2006-02-27 18:34                                         ` Christopher Faylor
2006-02-27  9:19                                     ` Andreas Ericsson
2006-02-27 18:45                                       ` Rutger Nijlunsing
2006-03-02 13:40                                         ` Alex Riesen
2006-03-02 14:10                                   ` [PATCH] fmt-merge-msg: avoid open "-|" list form for Perl 5.6 Alex Riesen
2006-03-02 15:00                                     ` Christopher Faylor
2006-03-02 16:10                                       ` Alex Riesen
2006-03-02 17:39                                         ` Andreas Ericsson
2006-03-02 22:01                                           ` Alex Riesen
2006-02-26 20:33                               ` Christopher Faylor
2006-02-24 12:02               ` Eric Wong
2006-02-24 13:44                 ` Johannes Schindelin
2006-02-24 16:14                   ` Linus Torvalds
2006-02-21 20:56       ` Eric Wong
2006-02-21 22:04         ` Alex Riesen
     [not found]           ` <1cf1c57a0602211412r1988b14ao435edd29207dc0d0@mail.gmail.com>
2006-02-21 22:13             ` Ron Parker
  -- strict thread matches above, loose matches on Subject: below --
2006-03-02 16:44 Christopher Faylor
2006-03-02 16:55 ` Shawn Pearce
2006-03-02 22:09   ` Alex Riesen
2006-03-02 23:27     ` Linus Torvalds
2006-03-03  0:34       ` Junio C Hamano
2006-03-03  0:49         ` Linus Torvalds
2006-03-03  1:25           ` Junio C Hamano
2006-03-03  1:52             ` Linus Torvalds
2006-03-03  0:14     ` Christopher Faylor
2006-03-02 17:33 ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0602231143290.3771@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).