Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jay Soffian <jaysoffian@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: allowing aliases to override builtins to support default options
Date: Fri, 06 Mar 2009 15:22:36 -0800	[thread overview]
Message-ID: <7vhc26qls3.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <76718490903061430s2fbea2dfibe06282fd22b1588@mail.gmail.com> (Jay Soffian's message of "Fri, 6 Mar 2009 17:30:43 -0500")

Jay Soffian <jaysoffian@gmail.com> 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

  parent reply	other threads:[~2009-03-06 23:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06 22:30 allowing aliases to override builtins to support default options Jay Soffian
2009-03-06 22:37 ` Sverre Rabbelier
2009-03-06 23:22 ` Junio C Hamano [this message]
2009-03-06 23:51   ` Jay Soffian
2009-03-07  2:37 ` Johannes Schindelin
2009-03-07  2:57   ` Jay Soffian
2009-03-07  3:10     ` 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=7vhc26qls3.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    /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