{"thread":{"id":"9625","subject":"[PATCH 1/2] Add \"--only-untracked\" flag to status commands.","startedAt":"2007-08-23T19:58:31Z","lastAt":"2007-08-24T06:28:51Z","messageCount":4,"participants":["Väinö Järvelä","Matthieu Moy"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"51392","messageId":"11878991123605-git-send-email-v@pp.inet.fi","threadId":"9625","inReplyTo":null,"subject":"[PATCH 1/2] Add \"--only-untracked\" flag to status commands.","fromName":"Väinö Järvelä","fromEmail":"v@pp.inet.fi","sentAt":"2007-08-23T19:58:31Z","receivedAt":"2007-08-23T19:58:31Z","isPatch":true,"sender":{"key":"v@pp.inet.fi","avatar":null},"body":"With this flag, the user can choose to filter untracked files from the\nstatus output. This can be used to either speed up the status output, as\nthe untracked files are not fetched at all, or to just cleanup the\noutput without using gitignore.\n\nSigned-off-by: Väinö Järvelä <v@pp.inet.fi>\n---\n builtin-runstatus.c |    4 +++-\n git-commit.sh       |   11 +++++++++--\n wt-status.c         |    8 +++++++-\n wt-status.h         |    1 +\n 4 files changed, 20 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-runstatus.c b/builtin-runstatus.c\nindex 2db25c8..2121762 100644\n--- a/builtin-runstatus.c\n+++ b/builtin-runstatus.c\n@@ -5,7 +5,7 @@\n extern int wt_status_use_color;\n \n static const char runstatus_usage[] =\n-\"git-runstatus [--color|--nocolor] [--amend] [--verbose] [--untracked]\";\n+\"git-runstatus [--color|--nocolor] [--amend] [--verbose] [--untracked]\" \"[--only-tracked]\";\n \n int cmd_runstatus(int argc, const char **argv, const char *prefix)\n {\n@@ -28,6 +28,8 @@ int cmd_runstatus(int argc, const char **argv, const char *prefix)\n \t\t\ts.verbose = 1;\n \t\telse if (!strcmp(argv[i], \"--untracked\"))\n \t\t\ts.untracked = 1;\n+\t\telse if (!strcmp(argv[i], \"--only-tracked\"))\n+\t\t\ts.only_tracked = 1;\n \t\telse\n \t\t\tusage(runstatus_usage);\n \t}\ndiff --git a/git-commit.sh b/git-commit.sh\nindex d7e7028..0ef50d9 100755\n--- a/git-commit.sh\n+++ b/git-commit.sh\n@@ -3,7 +3,7 @@\n # Copyright (c) 2005 Linus Torvalds\n # Copyright (c) 2006 Junio C Hamano\n \n-USAGE='[-a | --interactive] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit> | --amend] [-u] [-e] [--author <author>] [--template <file>] [[-i | -o] <path>...]'\n+USAGE='[-a | --interactive] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit> | --amend] [-u] [-e] [--author <author>] [--template <file>] [--only-tracked] [[-i | -o] <path>...]'\n SUBDIRECTORY_OK=Yes\n . git-sh-setup\n require_work_tree\n@@ -56,7 +56,8 @@ run_status () {\n \tgit runstatus ${color} \\\n \t\t${verbose:+--verbose} \\\n \t\t${amend:+--amend} \\\n-\t\t${untracked_files:+--untracked}\n+\t\t${untracked_files:+--untracked} \\\n+\t\t${only_tracked:+--only-tracked}\n }\n \n trap '\n@@ -87,6 +88,7 @@ signoff=\n force_author=\n only_include_assumed=\n untracked_files=\n+only_tracked=\n templatefile=\"`git config commit.template`\"\n while case \"$#\" in 0) break;; esac\n do\n@@ -269,6 +271,11 @@ $1\"\n \t\tuntracked_files=t\n \t\tshift\n \t\t;;\n+    --only-|--only-t|--only-tr|--only-tra|--only-trac|--only-track|\\\n+    --only-tracke|--only-tracked)\n+        only_tracked=t\n+        shift\n+        ;;\n \t--)\n \t\tshift\n \t\tbreak\ndiff --git a/wt-status.c b/wt-status.c\nindex 5205420..7c2c468 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -331,7 +331,13 @@ void wt_status_print(struct wt_status *s)\n \t}\n \n \twt_status_print_changed(s);\n-\twt_status_print_untracked(s);\n+\n+\tif (!s->only_tracked) {\n+\t\twt_status_print_untracked(s);\n+\t}\n+\telse {\n+\t\tprintf(\"# Untracked files were filtered by \\\"--only-tracked\\\"\\n\");\n+\t}\n \n \tif (s->verbose && !s->is_initial)\n \t\twt_status_print_verbose(s);\ndiff --git a/wt-status.h b/wt-status.h\nindex cfea4ae..45b7e09 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -15,6 +15,7 @@ struct wt_status {\n \tint verbose;\n \tint amend;\n \tint untracked;\n+\tint only_tracked;\n \t/* These are computed during processing of the individual sections */\n \tint commitable;\n \tint workdir_dirty;\n-- \n1.5.3.rc6.17.g1911-dirty\n"},{"id":"51393","messageId":"11878991173082-git-send-email-v@pp.inet.fi","threadId":"9625","inReplyTo":"11878991123605-git-send-email-v@pp.inet.fi","subject":"[PATCH 2/2] Documented \"--only-untracked\" flag.","fromName":"Väinö Järvelä","fromEmail":"v@pp.inet.fi","sentAt":"2007-08-23T19:58:32Z","receivedAt":"2007-08-23T19:58:32Z","isPatch":true,"sender":{"key":"v@pp.inet.fi","avatar":null},"body":"Also moved a paragraph about git-status options from description\nsection, to options section. Which makes it easier to quickly search for\ngit-status options without reading the description, even though the\ndescription for options forwards to git-commit manual.\n\nSigned-off-by: Väinö Järvelä <v@pp.inet.fi>\n---\n Documentation/git-runstatus.txt |    4 +++-\n Documentation/git-status.txt    |   17 ++++++++++++-----\n 2 files changed, 15 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-runstatus.txt b/Documentation/git-runstatus.txt\nindex dee5d0d..56af1c1 100644\n--- a/Documentation/git-runstatus.txt\n+++ b/Documentation/git-runstatus.txt\n@@ -8,7 +8,7 @@ git-runstatus - A helper for git-status and git-commit\n \n SYNOPSIS\n --------\n-'git-runstatus' [--color|--nocolor] [--amend] [--verbose] [--untracked]\n+'git-runstatus' [--color|--nocolor] [--amend] [--verbose] [--untracked] [--only-tracked]\n \n \n DESCRIPTION\n@@ -47,6 +47,8 @@ OPTIONS\n \toption only its name and a trailing slash are displayed\n \tfor each untracked directory.\n \n+--only-tracked:\n+\tHide untracked files from the output.\n \n OUTPUT\n ------\ndiff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\nindex 8fd0fc6..de9f5ff 100644\n--- a/Documentation/git-status.txt\n+++ b/Documentation/git-status.txt\n@@ -8,7 +8,7 @@ git-status - Show the working tree status\n \n SYNOPSIS\n --------\n-'git-status' <options>...\n+'git-status' [--only-tracked] <options>...\n \n DESCRIPTION\n -----------\n@@ -23,10 +23,6 @@ If there is no path that is different between the index file and\n the current HEAD commit, the command exits with non-zero\n status.\n \n-The command takes the same set of options as `git-commit`; it\n-shows what would be committed if the same options are given to\n-`git-commit`.\n-\n If any paths have been touched in the working tree (that is,\n their modification times have changed) but their contents and\n permissions are identical to those in the index file, the command\n@@ -35,6 +31,17 @@ subsequent operations such as `git-diff` if the working tree\n contains many paths that have been touched but not modified.\n \n \n+OPTIONS\n+-------\n+--only-tracked::\n+\tHide untracked files from the output.\n+\n+<options>::\n+\tThe command takes the same set of options as `git-commit`; it\n+\tshows what would be committed if the same options are given to\n+\t`git-commit`.\n+\n+\n OUTPUT\n ------\n The output from this command is designed to be used as a commit\n-- \n1.5.3.rc6.17.g1911-dirty\n"},{"id":"51402","messageId":"vpqabsikmbg.fsf@bauges.imag.fr","threadId":"9625","inReplyTo":"11878991123605-git-send-email-v@pp.inet.fi","subject":"Re: [PATCH 1/2] Add \"--only-untracked\" flag to status commands.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-08-23T20:50:11Z","receivedAt":"2007-08-23T20:50:11Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Väinö Järvelä <v@pp.inet.fi> writes:\n\n> Subject: Re: [PATCH 1/2] Add \"--only-untracked\" flag to status commands.\n                                       ^^\n\nI suppose you meant --only-tracked.\n\n>  static const char runstatus_usage[] =\n> -\"git-runstatus [--color|--nocolor] [--amend] [--verbose] [--untracked]\";\n> +\"git-runstatus [--color|--nocolor] [--amend] [--verbose]\n> [--untracked]\" \"[--only-tracked]\";\n               ^^^\n\nThe compiler will concatenate the strings, but won't add a space. That\nresults in \"... [--untracked][--only-tracked]\".\n\nOtherwise, the patch sounds fine to me. Not /terribly/ usefull, but\nwhy not.\n\n-- \nMatthieu\n"},{"id":"51422","messageId":"1C01FFED-1C80-4C1F-A73D-2529B5B81F7E@pp.inet.fi","threadId":"9625","inReplyTo":"vpqabsikmbg.fsf@bauges.imag.fr","subject":"Re: [PATCH 1/2] Add \"--only-untracked\" flag to status commands.","fromName":"Väinö Järvelä","fromEmail":"v@pp.inet.fi","sentAt":"2007-08-24T06:28:51Z","receivedAt":"2007-08-24T06:28:51Z","isPatch":true,"sender":{"key":"v@pp.inet.fi","avatar":null},"body":"On Aug 23, 2007, at 23:50, Matthieu Moy wrote:\n\n> Väinö Järvelä <v@pp.inet.fi> writes:\n>\n>> Subject: Re: [PATCH 1/2] Add \"--only-untracked\" flag to status  \n>> commands.\n>                                        ^^\n>\n> I suppose you meant --only-tracked.\n\nYes, a stupid typo. It should be --only-tracked.\n\n>>  static const char runstatus_usage[] =\n>> -\"git-runstatus [--color|--nocolor] [--amend] [--verbose] [-- \n>> untracked]\";\n>> +\"git-runstatus [--color|--nocolor] [--amend] [--verbose]\n>> [--untracked]\" \"[--only-tracked]\";\n>                ^^^\n>\n> The compiler will concatenate the strings, but won't add a space. That\n> results in \"... [--untracked][--only-tracked]\".\n\nShould have checked it more properly, sorry about that.\n\n>\n> Otherwise, the patch sounds fine to me. Not /terribly/ usefull, but\n> why not.\n\nThis is something that has come up many times on our project, there  \nmight be a lot of temporary files that are used inside the project  \ntree, to test the code, and the user just wants to see the  \nmodifications to tracked files without using a pager. One could use  \ngitignore, but in our case, it would be hard to create a gitignore  \nwhich would ignore all of the test files, and none of the actual  \nproject files, so it's quite convenient to use --only-tracked.\n\nA better behavior might be to test outside of the project tree.\n\n>\n> -- \n> Matthieu\n\n--\nVäinö"}]}