{"thread":{"id":"1468","subject":"[PATCH] -x (no-exclude) option for cg-status","startedAt":"2005-08-10T18:42:19Z","lastAt":"2005-08-10T18:42:19Z","messageCount":1,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7034","messageId":"1123699339.17725.13.camel@dv","threadId":"1468","inReplyTo":null,"subject":"[PATCH] -x (no-exclude) option for cg-status","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-08-10T18:42:19Z","receivedAt":"2005-08-10T18:42:19Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\nI'm trying to reimplement my cg-clean script so that it reuses more code\nfrom other utilities.  This patch makes it possible to call cg-status\nfrom cg-clean.\n\nThis patch adds the \"-x\" option that instructs cg-status not to ignore\nany files.  Also, the code has been changed to add standard includes in\na loop.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\ndiff --git a/cg-status b/cg-status\n--- a/cg-status\n+++ b/cg-status\n@@ -34,6 +34,9 @@\n # -w::\n #\tShow the working tree file list.\n #\n+# -x::\n+#\tDon't exclude any files from listing.\n+#\n # FILES\n # -----\n # $GIT_DIR/exclude::\n@@ -53,11 +56,14 @@ USAGE=\"cg-status [-g] [-w]\"\n \n gitstatus=\n workstatus=\n+noexclude=\n while optparse; do\n \tif optparse -g; then\n \t\tgitstatus=1\n \telif optparse -w; then\n \t\tworkstatus=1\n+\telif optparse -x; then\n+\t\tnoexclude=1\n \telse\n \t\toptfail\n \tfi\n@@ -116,18 +122,21 @@ fi\n \n \n if [ \"$workstatus\" ]; then\n-\tEXCLUDEFILE=$_git/exclude\n \tEXCLUDE=\n-\tif [ -f $EXCLUDEFILE ]; then\n-\t\tEXCLUDE=\"$EXCLUDE --exclude-from=$EXCLUDEFILE\"\n+\tif [ -z \"$noexclude\" ]; then\n+\t\tEXCLUDEFILE=$_git/exclude\n+\t\tfor excl in '*.[ao]' '.*' tags '*~' '#*' ',,merge*'; do\n+\t\t\tEXCLUDE=\"$EXCLUDE --exclude=$excl\"\n+\t\tdone\n+\t\tif [ -f $EXCLUDEFILE ]; then\n+\t\t\tEXCLUDE=\"$EXCLUDE --exclude-from=$EXCLUDEFILE\"\n+\t\tfi\n+\t\tEXCLUDE=\"$EXCLUDE --exclude-per-directory=.gitignore\"\n \tfi\n \n \tgit-update-cache --refresh > /dev/null\n \n-\tgit-ls-files --others --exclude='*.[ao]' --exclude='.*' --exclude=tags \\\n-\t\t--exclude='*~' --exclude='#*' \\\n-\t\t--exclude=',,merge*' $EXCLUDE \\\n-\t\t--exclude-per-directory=.gitignore |\n+\tgit-ls-files --others $EXCLUDE |\n \t\t{ if [ \"$_git_relpath\" ]; then sed -n \"s|^$_git_relpath||p\"; else cat; fi } |\n \t\tsed 's,^,? ,'\n \n\n\n-- \nRegards,\nPavel Roskin\n"}]}