git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Nicolas Pitre <nico@cam.org>
Cc: David Kastrup <dak@gnu.org>, git@vger.kernel.org
Subject: Re: [PATCH] Make "git reset" a builtin. (incomplete)
Date: Wed, 22 Aug 2007 20:23:46 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.999.0708222006110.30176@woody.linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.0.999.0708222033040.16727@xanadu.home>



On Wed, 22 Aug 2007, Nicolas Pitre wrote:
> 
> > We ended up writing our own versions (or merging other peoples code) for 
> > things like appying patches, generating diffs, three-way merging etc, 
> > because not having external dependencies is *so* much more maintainable 
> > and portable that it's not even funny.
> 
> Indeed. And this is the very same reason why Git should _also_ acquire a 
> script interpreter of its own if we want to continue bragging about 
> Git's easy scriptability.

I suspect that most people who want scriptability want it within the 
confines of whatever environment they run in.

For example, I swear by git's scriptability, but I do so not because I 
think it would be a good idea to script _within_ git using some magic 
language, but because I think we made good design decisions that makes it 
easy to integrate git with the kinds of scripts I write every day.

But the kinds of scriping *I* do has nothing to do with the kinds of 
scripting other people necessarily do. I use shell pipelines, and quite 
frankly, any "internal" scripting inside of git is totally uninteresting 
to me, exactly because I'm used to the generic UNIX tools, and I find it 
damn interesting to do things like

	git log -p --since=6.months | cut -c1 | sort | uniq -c

and use that as a really cheesy way to see how many lines have gotten 
added/removed in the patches in the last 6 months.

(Yeah, I get some other characters than just "+/-" too, I don't care, the 
part I care about is:

	 749754 -
	  96945 @
	1030104 +

ie about a hundred thousand hunks, with an average of 7.5 lines deleted 
per hunk, and 10 lines added)

See? Sure, some kind of internal git scripting language could do things 
like this too, but that defeats the point: it's that git is useful 
*within* a UNIX scripting environment, not that it makes its own.

There are enough scripting languages out there. It's wonderful if git can 
be used with then, rather than having to make up another language that you 
have to learn.

And yes, I agree with people who say that LUA is probably the best choice 
if people really want a scripting language, but would I actually use LUA 
for something like the above? No. I think that people who look for 
scriptability usually prefer the kind of scriptability that git already 
has, namely that it fits into their *existing* setup.

> > I'd love for every single shell-script in git core to be written in C, so 
> > that we can drop the dependency on shell *entirely*.
> 
> What about the test suite?

The test suite is indeed special. But I think that's a "build requiement", 
and if we require something like shell for *building*, that's different 
from requiring normal users to have it.

If somebody wants to re-code the test-suite in some other scripting 
engine, that would be fine by me. I'd hope you can automate it, though: 
that is a *lot* of lines of shell.

			Linus

  parent reply	other threads:[~2007-08-23  3:24 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-22 12:48 [PATCH] Make "git reset" a builtin. (incomplete) Carlos Rica
2007-08-22 13:00 ` David Kastrup
2007-08-22 13:37   ` Andreas Ericsson
2007-08-22 14:29     ` David Kastrup
2007-08-22 14:49       ` Mike Hommey
2007-08-22 15:02         ` Chris Shoemaker
2007-08-22 15:41           ` David Kastrup
2007-08-22 16:07       ` Nicolas Pitre
2007-08-22 16:51         ` Johannes Schindelin
2007-08-22 17:17           ` David Kastrup
2007-08-22 19:05             ` Linus Torvalds
2007-08-22 19:36               ` David Kastrup
2007-08-22 19:58                 ` Linus Torvalds
2007-08-22 22:25                   ` David Kastrup
2007-08-22 23:10                     ` Linus Torvalds
2007-08-22 23:39                       ` David Kastrup
2007-08-23  1:30                         ` Linus Torvalds
2007-08-23  0:24                     ` Wincent Colaiuta
2007-08-23  1:15               ` Nicolas Pitre
2007-08-23  1:40                 ` Jon Smirl
2007-08-23  3:23                 ` Linus Torvalds [this message]
2007-08-23  4:21                   ` Junio C Hamano
2007-08-23  9:15                   ` Johannes Schindelin
2007-08-22 21:34             ` Reece Dunn
2007-08-23  9:10               ` Johannes Schindelin
2007-08-23 10:20                 ` Theodore Tso
2007-08-23 10:31                   ` Johannes Schindelin
2007-08-23 10:55                   ` David Tweed
2007-08-23 11:24                     ` Theodore Tso
2007-08-23 11:35                       ` Johannes Schindelin
2007-08-23 16:30                       ` Jon Smirl
2007-08-23 11:25                     ` Reece Dunn
2007-08-23 20:26             ` Alex Riesen
2007-08-23 21:14               ` David Kastrup
2007-08-23 21:33                 ` Alex Riesen
2007-08-23 22:05                   ` David Kastrup
2007-08-22 17:21           ` Nicolas Pitre
2007-08-23  9:55             ` Johannes Schindelin
2007-08-23 15:19               ` Nicolas Pitre
2007-08-22 21:19           ` Reece Dunn
2007-08-23  9:05             ` Johannes Schindelin
2007-08-23 18:40             ` Robin Rosenberg
2007-08-23  2:05       ` Nguyen Thai Ngoc Duy
2007-08-22 13:42   ` Matthieu Moy
2007-08-22 22:28     ` David Kastrup
2007-08-22 14:27   ` Andy Parkins
2007-08-22 14:57 ` Johannes Sixt
2007-08-22 16:20 ` Alex Riesen
2007-08-23 11:14 ` 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=alpine.LFD.0.999.0708222006110.30176@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=dak@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=nico@cam.org \
    /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).