Re: Problem completing remotes when .git/remotes exits
- From
SZEDER Gábor <szeder@ira.uka.de>
- Date
- Sep 26, 2012, 11:43 UTC
- Message-ID
- <20120926114315.GF10144@goldbirke>
- In-Reply-To
- <7vbogtvfb4.fsf@alter.siamese.dyndns.org>
On Tue, Sep 25, 2012 at 04:43:59PM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> SZEDER Gábor <szeder@ira.uka.de> writes: > > > - test -d "$d/remotes" && ls -1 "$d/remotes" > > + test -d "$d/remotes" && command ls -1 "$d/remotes" > > Yuck. For normal scripts, nobody sane would define "alias" for > non-interactive environments, but because these things work in an > interactive environment, we have to protect ourselves from user > aliases. Not just "ls", but "test" we see above may misbehave X-<.
Right, however, while ls is frequently aliased (my ubuntu box has alias ls='ls --color=auto' in /etc/skel/.bashrc by default, but that's not an issue in this case), I think aliasing test is just crazy. Yeah, it's possible, but if we go down that route, then we should also worry about the [ builtin being aliased:
$ if [ -r nonexisting ] ; then echo found ; fi $ alias [='echo using aliased [' $ if [ -r nonexisting ] ; then echo found ; fi using aliased [ -r nonexisting ] found $