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

Re: [PATCH] difftool: avoid symlinks when reusing worktree files

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 30, 2015, 16:19 UTC
Message-ID
<xmqqio5omirl.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20151030072857.GA15031@gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 9 quoted lines
>> +	if (-l "$workdir/$file" || ! -e _) {
>>  		return (0, $null_sha1);
>>  	}
>
> The "-e _" shorthand caught my eye ~ I didn't know perl could do that!
> Nice.
>
> Underline is barely mentioned in perlvar, but it's obvious what
> (I think) it means, and since Perl is DWIM, it must be right. ;-)

It is mentioned under -X (i.e. the headline for -f, -e, -d, ... tests) in perlfunc with an interesting example of doing an explicit stat() first and then running many variants of -X with _ as the target.

Previous: David AguilarNext: Junio C Hamano
Message 7 of 8 in “difftool: avoid symlinks when reusing worktree files”
  1. difftool: avoid symlinks when reusing worktree filesDavid Aguilar, Oct 27, 2015
  2. Junio C HamanoOct 27, 2015
  3. David AguilarOct 29, 2015
  4. Junio C HamanoOct 29, 2015
  5. Junio C HamanoOct 29, 2015
  6. David AguilarOct 30, 2015
  7. Junio C HamanoOct 30, 2015
  8. Junio C HamanoOct 27, 2015

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.