{"thread":{"id":"1668","subject":"[PATCH] Teach git-status-script about git-ls-files --others","startedAt":"2005-08-27T01:18:59Z","lastAt":"2005-08-27T01:18:59Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7828","messageId":"7vfysw89do.fsf@assigned-by-dhcp.cox.net","threadId":"1668","inReplyTo":null,"subject":"[PATCH] Teach git-status-script about git-ls-files --others","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-27T01:18:59Z","receivedAt":"2005-08-27T01:18:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When there is non-empty $GIT_DIR/info/exclude file, use it along\nwith .gitignore per-directory exclude pattern files (which was\na convention agreed on the list while ago and is compatible with\nCogito) to generate a list of ignored files as well.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n git-status-script |   32 ++++++++++++++++++++++++++++++--\n 1 files changed, 30 insertions(+), 2 deletions(-)\n\n5444043b5f5a2464938acd6da9408ec55ca40249\ndiff --git a/git-status-script b/git-status-script\n--- a/git-status-script\n+++ b/git-status-script\n@@ -1,4 +1,7 @@\n #!/bin/sh\n+#\n+# Copyright (c) 2005 Linus Torvalds\n+#\n . git-sh-setup-script || die \"Not a git archive\"\n \n report () {\n@@ -33,10 +36,35 @@ case \"$branch\" in\n refs/heads/master) ;;\n *)\techo \"# On branch $branch\" ;;\n esac\n+\n git-update-cache --refresh >/dev/null 2>&1\n-git-diff-cache -M --cached HEAD | sed 's/^://' | report \"Updated but not checked in\" \"will commit\"\n+\n+git-diff-cache -M --cached HEAD |\n+sed 's/^://' |\n+report \"Updated but not checked in\" \"will commit\"\n+\n committable=\"$?\"\n-git-diff-files | sed 's/^://' | report \"Changed but not updated\" \"use git-update-cache to mark for commit\"\n+\n+git-diff-files |\n+sed 's/^://' |\n+report \"Changed but not updated\" \"use git-update-cache to mark for commit\"\n+\n+if grep -v '^#' \"$GIT_DIR/info/exclude\" >/dev/null 2>&1\n+then\n+\tgit-ls-files --others \\\n+\t    --exclude-from=\"$GIT_DIR/info/exclude\" \\\n+\t    --exclude-per-directory=.gitignore |\n+\tsed -e '\n+\t1i\\\n+#\\\n+# Ignored files:\\\n+#   (use \"git add\" to add to commit)\\\n+#\n+\ts/^/#\t/\n+\t$a\\\n+#'\n+fi\n+\n if [ \"$committable\" == \"0\" ]\n then\n \techo \"nothing to commit\"\n"}]}