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

"git status" should warn/error when it cannot lists a directory

From
Andrew Wong <andrew.kw.w@gmail.com>
Date
Feb 2, 2015, 16:58 UTC
Message-ID
<CADgNjamcR+b-_DKzScU=35idAgG542B7CaJC2AqAE9Srvsq17g@mail.gmail.com>

When "git status" recurses a directory that isn't readable (but executable), it should print out a warning/error. Currently, if there are untracked files in these directories, git wouldn't be able to discover them. Ideally, "git status" should return a non-zero exit code as well.

The problem seems to be In read_directory_recursive() from dir.c. When opendir() returns null, we continue on ignoring any error. Is there a scenario where returning null is expected? We can simply call perror() here, but it would be nice if we can propagate the error to the exit code too. How would we do that?

Next: Jeff King
Message 1 of 2 in “"git status" should warn/error when it cannot lists a directory”
  1. Andrew WongFeb 2, 2015
  2. Jeff KingFeb 3, 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.