Re: allowing aliases to override builtins to support default options

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: allowing aliases to override builtins to support default options

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:20

Jay Soffian [off-list ref] writes:
Currently git does not allow aliases to override builtins. I
understand the reasoning behind this, but I wonder if it's overly
conservative.
It is not.
Most shells support overriding commands with aliases, and I'm not sure
why git needs to be more conservative than the shell.
Because sane shells do not expand aliases when used in a script, and gives
a handy way to defeat the alias even from the command line.

    $ alias ls='ls -aF'
    $ echo ls >script
    $ chmod +x script

and compare:

    $ ./script
    $ ls
    $ /bin/ls

Re: allowing aliases to override builtins to support default options

From: Jay Soffian <hidden>
Date: 2016-06-15 22:46:20

On Fri, Mar 6, 2009 at 6:22 PM, Junio C Hamano [off-list ref] wrote:
Because sane shells do not expand aliases when used in a script, and gives
a handy way to defeat the alias even from the command line.

   $ alias ls='ls -aF'
   $ echo ls >script
   $ chmod +x script

and compare:

   $ ./script
   $ ls
   $ /bin/ls
Understood. And if git could do the same, still no?

j.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help