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

[PATCH] git status: print files under untracked dir if -a is given

From
Yasushi SHOJI <yashi@atmark-techno.com>
Date
May 30, 2006, 08:46 UTC
Message-ID
<87slmrdhe6.wl@mail2.atmark-techno.com>
git status: print files under untracked dir if -a is given

git status (git-commit.sh) currently doesn't show files under untracked directory. this is inconvenient when adding many files under new directory.

this patch change its behavior to show files under untracked directory if option --all is given.

Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
---
3d3fa8f19c7d9b03b1a6e510970633ec8be7adac
 git-commit.sh |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
3d3fa8f19c7d9b03b1a6e510970633ec8be7adac
diff --git a/git-commit.sh b/git-commit.sh
index 6ef1a9d..0cde305 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -134,13 +134,18 @@ #'
 	report "Changed but not updated" \
 	    "use git-update-index to mark for commit"
 
+	if test -z "$all"
+	then
+	    directory_opt="--directory"
+	fi
+
 	if test -f "$GIT_DIR/info/exclude"
 	then
-	    git-ls-files -z --others --directory \
+	    git-ls-files -z --others $directory_opt \
 		--exclude-from="$GIT_DIR/info/exclude" \
 		--exclude-per-directory=.gitignore
 	else
-	    git-ls-files -z --others --directory \
+	    git-ls-files -z --others $directory_opt \
 		--exclude-per-directory=.gitignore
 	fi |
 	perl -e '$/ = "\0";
-- 
1.3.3.g70f7
Next: Junio C Hamano
Message 1 of 3 in “git status: print files under untracked dir if -a is given”
  1. git status: print files under untracked dir if -a is givenYasushi SHOJI, May 30, 2006
  2. Junio C HamanoMay 30, 2006
  3. Yasushi SHOJIMay 30, 2006

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.