git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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 $

Previous: Junio C HamanoNext: SZEDER Gábor
Message 4 of 6 in “Problem completing remotes when .git/remotes exits”
  1. Johannes SixtSep 19, 2012
  2. SZEDER GáborSep 25, 2012
  3. Junio C HamanoSep 25, 2012
  4. SZEDER GáborSep 26, 2012
  5. SZEDER GáborSep 26, 2012
  6. SZEDER GáborSep 26, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.