threads / discuss / 10627

Advanced aliases with arguments (?)

Subject: Advanced aliases with arguments (?)

## tl;dr

2 messages between Nov 4, 2007 and Nov 4, 2007.

replies: 1people: 1as markdown or json

Mike Hommey· Nov 4, 2007, 00:40 UTC · lore
Hi,
I read on http://git.or.cz/gitwiki/Aliases that
        Starting with version 1.5.3, git supports appending the
        arguments to commands prefixed with "!", too. If you need to
        perform a reordering, or to use an argument twice, you can use
        this trick:
        [alias]
                example = !sh -c "ls $1 $0"

AFAICT, it doesn't work with the 1.5.3.5 I use. Is it false advertising or was there some regression ?

Mike
Mike Hommey· Nov 4, 2007, 00:45 UTC · re: Mike Hommey · lore

Re: Advanced aliases with arguments (?)

On Sun, Nov 04, 2007 at 01:40:20AM +0100, Mike Hommey wrote:
Show 15 quoted lines
> Hi,
> 
> I read on http://git.or.cz/gitwiki/Aliases that
> 
>         Starting with version 1.5.3, git supports appending the
>         arguments to commands prefixed with "!", too. If you need to
>         perform a reordering, or to use an argument twice, you can use
>         this trick:
> 
>         [alias]
>                 example = !sh -c "ls $1 $0"
> 
> 
> AFAICT, it doesn't work with the 1.5.3.5 I use. Is it false advertising
> or was there some regression ?

Aaaah it does work, but you need to use single quotes, not double quotes.

Mike

← back to recent threads