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

[PATCH 1/4] dir: fix a few confusing comments

From
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
Date
Jun 11, 2020, 06:59 UTC
Message-ID
<d8e050701bde53084a337ec0bde40af8ff392ae5.1591858774.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.806.git.git.1591858774.gitgitgadget@gmail.com>
From: Elijah Newren <newren@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
---
 dir.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dir.c b/dir.c
index d97e9558489..6fb2f8ecdd7 100644
--- a/dir.c
+++ b/dir.c
@@ -1820,7 +1820,7 @@ static enum path_treatment treat_directory(struct dir_struct *dir,
 	 * to recurse into untracked/ignored directories if either of the
 	 * following bits is set:
 	 *   - DIR_SHOW_IGNORED_TOO (because then we need to determine if
-	 *                           there are ignored directories below)
+	 *                           there are ignored entries below)
 	 *   - DIR_HIDE_EMPTY_DIRECTORIES (because we have to determine if
 	 *                                 the directory is empty)
 	 */
@@ -1838,10 +1838,11 @@ static enum path_treatment treat_directory(struct dir_struct *dir,
 		return path_excluded;
 
 	/*
-	 * If we have we don't want to know the all the paths under an
-	 * untracked or ignored directory, we still need to go into the
-	 * directory to determine if it is empty (because an empty directory
-	 * should be path_none instead of path_excluded or path_untracked).
+	 * Even if we don't want to know all the paths under an untracked or
+	 * ignored directory, we may still need to go into the directory to
+	 * determine if it is empty (because with DIR_HIDE_EMPTY_DIRECTORIES,
+	 * an empty directory should be path_none instead of path_excluded or
+	 * path_untracked).
 	 */
 	check_only = ((dir->flags & DIR_HIDE_EMPTY_DIRECTORIES) &&
 		      !(dir->flags & DIR_SHOW_IGNORED_TOO));
-- 
gitgitgadget
Previous: Elijah Newren via GitGitGadgetNext: Elijah Newren via GitGitGadget
Message 2 of 7 in “Clean cleanups”
  1. 0/4 Clean cleanupsElijah Newren via GitGitGadget, Jun 11, 2020
  2. 1/4 dir: fix a few confusing commentsElijah Newren via GitGitGadget, Jun 11, 2020
  3. 2/4 dir, clean: avoid disallowed behaviorElijah Newren via GitGitGadget, Jun 11, 2020
  4. 3/4 clean: consolidate handling of ignored parametersElijah Newren via GitGitGadget, Jun 11, 2020
  5. 4/4 clean: optimize and document cases where we recurse into subdirectoriesElijah Newren via GitGitGadget, Jun 11, 2020
  6. Junio C HamanoJun 13, 2020
  7. Brian MalehornJun 18, 2020

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.