git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: Theodore Tso <tytso@mit.edu>, git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] Make '!' aliases more useful
Date: Tue, 3 Jul 2007 12:27:35 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0707031217480.4071@racer.site> (raw)
In-Reply-To: <81b0412b0707030007o328f0b35hfa758e1f3b2ef289@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2082 bytes --]

Hi,

On Tue, 3 Jul 2007, Alex Riesen wrote:

> On 7/2/07, Theodore Tso <tytso@mit.edu> wrote:
> > On Mon, Jul 02, 2007 at 04:55:24PM +0100, Johannes Schindelin wrote:
> > > > But what if you don't want the argument passed at the end of the
> > > > alias, but somewhere else?  I suspect the better answer would be to
> > > > support $* and $1, $2, $3, et. al interpolation, no?  It was on my
> > > > list of things to do when I had a spare moment, but I never got around
> > > > to it.
> > >
> > > There is a point where you do not want to complicate git, but rather
> > write
> > > a script. This is such a point IMHO.
> > 
> > Such a point exists, I agree, but I would draw after $* and $1/$2/$3
> > interpolation.  There is a lot more value that gets added with
> > positional arguments support, and it makes git aliases more usable on
> > platforms such as Windows where scripting capability is much more
> > limited.
> 
> I don't think it is _possible_ to make it work on Windows properly: you have
> to quote the arguments with whitespaces as there is nothing like argv there
> (windows programs don't use command line, so it does not exist).

Since the "!" aliases use system() (i.e. no argv, but a plain string as 
parameter), my patch already does that. It quotes the arguments properly.

> As the quoting is implemented in the programs the rules are all different
> and mostly suboptimal.

You mean the programs that could be called via "!" aliases? Yes, that is 
right. And there is also the problem that you have to convert path names 
if you are working on Windows, because of this c:\&@!§$ braindamage.

However, in this case Junio's idea to use the shell to do the hard work is 
again an alternative:

	[alias]
		alex = !sh -c 'd:\program.exe $(cygpath -w "$1")'

FWIW I do not think that executing the shell from time to time is a big 
problem. It's only that I would like to get rid of the dependency on perl 
and bash for the plain Windows user, who will not dare to leave the gui 
into the command line jungle where there be bisons, yaccs and kills.

Ciao,
Dscho

      reply	other threads:[~2007-07-03 11:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-01 21:51 [PATCH] Make '!' aliases more useful Johannes Schindelin
2007-07-02 14:55 ` Theodore Tso
2007-07-02 15:55   ` Johannes Schindelin
2007-07-02 16:08     ` Theodore Tso
2007-07-02 23:11       ` Junio C Hamano
2007-07-03  1:14         ` Theodore Tso
2007-07-03  1:37           ` Johannes Schindelin
2007-07-03 12:10             ` Theodore Tso
2007-07-03  7:24           ` Johannes Sixt
2007-07-03  7:07       ` Alex Riesen
2007-07-03 11:27         ` Johannes Schindelin [this message]

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.0707031217480.4071@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=raa.lkml@gmail.com \
    --cc=tytso@mit.edu \
    /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).