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

Re: [RFC PATCH 0/3] git-p4: move to toplevel

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 14, 2012, 18:40 UTC
Message-ID
<7vaa4l8diz.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120214092048.GC1762@ecki>
Clemens Buchacher <drizzd@aon.at> writes:
Show 16 quoted lines
> On Mon, Feb 13, 2012 at 01:20:25PM -0800, Junio C Hamano wrote:
>> Clemens Buchacher <drizzd@aon.at> writes:
>> 
>> >> Erm,... do you really need the alias if you add git-p4 in a directory on
>> >> your $PATH?
>> >
>> > With recent git versions, this has stopped working.
>> 
>> Erm, I am confused.
>
> Looks like in my case it did not work because I had a PATH entry with a
> '~' in it. It probably stopped working for me because I moved some
> executables around.
>
> It's not a regression (I just tried with 1.6.0 and I get the same
> result).  And dash does not apply tilde expansion to PATH either.

I do not think tilde in $PATH is expanded by exec*p family to begin with, so it is not "dash" but POSIX, I would think. It is bash that is harming other programs, by trying to be more helpful, encouraging this user mistake to add ~ literally on the PATH.

You can see it in action below.

$ cd /var/tmp $ cat >execlptest.c <<\EOF #include <unistd.h> #include <errno.h> #include <string.h> #include <stdio.h>

int main(int ac, const char **av)
{
	int status = execlp("xyzzy", "xyzzy", NULL);
	printf("execlp returned %d (errno = %d, %s)\n",
	       status, errno, strerror(errno));
	return 0;
}
EOF
$ gcc -o execlptest execlptest.c
$ cat >/home/junio/junk/xyzzy <<\EOF
#!/bin/sh
exec lp test
EOF
$ chmod +x /home/junio/junk/xyzzy
$ PATH=/usr/bin:/bin
$ export PATH
$ /var/tmp/execlptest 
execlp returned -1 (errno = 2, No such file or directory)
: notice the sq pair around the value on the next line
$ PATH='/usr/bin:/bin:~/junk'; export PATH; echo "$PATH"
/usr/bin:/bin:~/junk
$ /var/tmp/execlptest 
execlp returned -1 (errno = 2, No such file or directory)
$ xyzzy
exec lp test
$ echo $BASH_VERSION
4.1.5(1)-release
Previous: Clemens BuchacherNext: Jeff King
Message 13 of 16 in “git-p4: move to toplevel”
  1. 0/3 git-p4: move to toplevelPete Wyckoff, Feb 12, 2012
  2. 1/3 git-p4: move to toplevelPete Wyckoff, Feb 12, 2012
  3. 2/3 git p4: update name in scriptPete Wyckoff, Feb 12, 2012
  4. 3/3 git p4: use "git p4" directly in testsPete Wyckoff, Feb 12, 2012
  5. Luke DiamandFeb 12, 2012
  6. Junio C HamanoFeb 13, 2012
  7. Pete WyckoffFeb 13, 2012
  8. Junio C HamanoFeb 13, 2012
  9. Clemens BuchacherFeb 13, 2012
  10. Junio C HamanoFeb 13, 2012
  11. Pete WyckoffFeb 13, 2012
  12. Clemens BuchacherFeb 14, 2012
  13. Junio C HamanoFeb 14, 2012
  14. Jeff KingFeb 14, 2012
  15. Junio C HamanoFeb 14, 2012
  16. Clemens BuchacherFeb 14, 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.