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

Re: [PATCH] git-new-workdir: Don't fail if the target directory is empty

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 18, 2014, 20:58 UTC
Message-ID
<xmqqegt0usy3.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1416344066.3899.25.camel@mad-scientist.net>
Paul Smith <paul@mad-scientist.net> writes:
Show 9 quoted lines
> I can't find a clear statement that both are required and that "ls -a"
> must show them.  I've used a wide range of UNIX-en and filesystems for
> 30 years or so and never seen one that didn't provide them.  It seems
> like it would break quite a few scripts, at least.  Even virtual
> filesystems like ClearCase's MVFS provide "." and "..".
>
> If you want to allow for this possibility I can do so but it would be a
> bit crufty.  Personally I think it would be overkill but you're the
> boss: let me know :-).

Doesn't the description of the -A option I quoted upthread hint a simpler and clearer solution? I.e. "test $(ls -A | wc -l) = 0"?

Previous: Paul SmithNext: Paul Smith
Message 6 of 9 in “git-new-workdir: Don't fail if the target directory is empty”
  1. git-new-workdir: Don't fail if the target directory is emptyPaul Smith, Nov 15, 2014
  2. Junio C HamanoNov 17, 2014
  3. Paul SmithNov 18, 2014
  4. Junio C HamanoNov 18, 2014
  5. Paul SmithNov 18, 2014
  6. Junio C HamanoNov 18, 2014
  7. Paul SmithNov 18, 2014
  8. Junio C HamanoNov 18, 2014
  9. Paul SmithNov 19, 2014

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.