{"thread":{"id":"20611","subject":"[PATCH 1/9] Documentation/git-commit.txt: describe --dry-run","startedAt":"2009-08-15T22:39:48Z","lastAt":"2009-08-17T08:57:26Z","messageCount":11,"participants":["Junio C Hamano","Thomas Rast"],"isPatch":true,"patchVersion":1,"patchTotal":9},"messages":[{"id":"120742","messageId":"1250375997-10657-1-git-send-email-gitster@pobox.com","threadId":"20611","inReplyTo":null,"subject":"[PATCH 0/9] \"git status\" that is not \"git commit --dry-run\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-15T22:39:48Z","receivedAt":"2009-08-15T22:39:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Here is an update relative to 7637868 (wt-status: collect untracked files\nin a separate \"collect\" phase, 2009-08-10) that has been queued in 'next'.\n\n[PATCH 1/9] and [PATCH 2/9] are the same from last night's fixes.\n\n[PATCH 3/9] through [PATCH 6/9] introduce a new \"git status\" with\ndifferent semantics for 1.7.0 under a tentative name \"git stat\".  They\nwill be squashed into one commit in the final round, as 4, 5, and 6 are\nfix-ups, but are keft separate for easier review.\n\n    The new \"git status\" handles paths differently from the traditional\n    one.  It used to be the preview of \"git commit paths...\", IOW,\n    \"show what would happen if we try to make a partial commit of only\n    these paths\".  The new \"git status\" only limits the paths the output\n    talks about and is not a preview of anything at all anymore.\n\n    Another semantic change is that its exit status no longer says if\n    there is something to be committed in the index.  We used to exit with\n    non-zero status if there is nothing to commit.\n\n[PATCH 7/9] introduces a short format output.\n\nThe last two patches make the new \"git status\" official.  They will be\nsquashed together into one commit in the final round, but are kept\nseparate for reviewability.\n\nJunio C Hamano (9):\n  Documentation/git-commit.txt: describe --dry-run\n  git commit --dry-run -v: show diff in color when asked\n  git stat: the beginning\n  git stat: honor relative paths setting\n  git stat: show traditional status headers and trailers as well\n  git stat: pathspec limits, unlike traditional \"git status\"\n  git stat -s: short status output\n  git status: not \"commit --dry-run\" anymore\n  git-status: adjust tests\n\n Documentation/git-commit.txt |   13 ++-\n Documentation/git-status.txt |   79 +++++++++++++++++---\n Makefile                     |    1 +\n builtin-commit.c             |  172 +++++++++++++++++++++++++++++++++++++-----\n t/t6040-tracking-info.sh     |    2 +-\n t/t7060-wtstatus.sh          |    8 +-\n t/t7506-status-submodule.sh  |    6 +-\n t/t7508-status.sh            |   12 ++-\n wt-status.c                  |   10 ++-\n wt-status.h                  |    1 +\n 10 files changed, 255 insertions(+), 49 deletions(-)\n"},{"id":"120741","messageId":"1250375997-10657-2-git-send-email-gitster@pobox.com","threadId":"20611","inReplyTo":"1250375997-10657-1-git-send-email-gitster@pobox.com","subject":"[PATCH 1/9] Documentation/git-commit.txt: describe --dry-run","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-15T22:39:49Z","receivedAt":"2009-08-15T22:39:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Signed-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Unchanged since the last round.\n\n Documentation/git-commit.txt |   13 +++++++++----\n 1 files changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex d01ff5a..64f94cf 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -9,7 +9,7 @@ SYNOPSIS\n --------\n [verse]\n 'git commit' [-a | --interactive] [-s] [-v] [-u<mode>] [--amend] [--dry-run]\n-\t   [(-c | -C) <commit>] [-F <file> | -m <msg>]\n+\t   [(-c | -C) <commit>] [-F <file> | -m <msg>] [--dry-run]\n \t   [--allow-empty] [--no-verify] [-e] [--author=<author>]\n \t   [--cleanup=<mode>] [--] [[-i | -o ]<file>...]\n \n@@ -42,10 +42,9 @@ The content to be added can be specified in several ways:\n    by one which files should be part of the commit, before finalizing the\n    operation.  Currently, this is done by invoking 'git-add --interactive'.\n \n-The 'git-status' command can be used to obtain a\n+The `--dry-run` option can be used to obtain a\n summary of what is included by any of the above for the next\n-commit by giving the same set of parameters you would give to\n-this command.\n+commit by giving the same set of parameters (options and paths).\n \n If you make a commit and then find a mistake immediately after\n that, you can recover from it with 'git-reset'.\n@@ -70,6 +69,12 @@ OPTIONS\n \tLike '-C', but with '-c' the editor is invoked, so that\n \tthe user can further edit the commit message.\n \n+--dry-run::\n+\tDo not actually make a commit, but show the list of paths\n+\twith updates in the index, paths with changes in the work tree,\n+\tand paths that are untracked, similar to the one that is given\n+\tin the commit log editor.\n+\n -F <file>::\n --file=<file>::\n \tTake the commit message from the given file.  Use '-' to\n-- \n1.6.4.224.g3be84\n"},{"id":"120743","messageId":"1250375997-10657-3-git-send-email-gitster@pobox.com","threadId":"20611","inReplyTo":"1250375997-10657-2-git-send-email-gitster@pobox.com","subject":"[PATCH 2/9] git commit --dry-run -v: show diff in color when asked","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-15T22:39:50Z","receivedAt":"2009-08-15T22:39:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The earlier implementation of --dry-run didn't duplicate the use of color\n\"git status -v\" set up for diff output.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Unchanged since the last round.\n\n builtin-commit.c |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 1c200eb..200ffda 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -979,9 +979,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \n \targc = parse_and_validate_options(argc, argv, builtin_commit_usage,\n \t\t\t\t\t  prefix, &s);\n-\tif (dry_run)\n+\tif (dry_run) {\n+\t\tif (diff_use_color_default == -1)\n+\t\t\tdiff_use_color_default = git_use_color_default;\n \t\treturn dry_run_commit(argc, argv, prefix, &s);\n-\n+\t}\n \tindex_file = prepare_index(argc, argv, prefix, 0);\n \n \t/* Set up everything for writing the commit object.  This includes\n-- \n1.6.4.224.g3be84\n"},{"id":"120745","messageId":"1250375997-10657-4-git-send-email-gitster@pobox.com","threadId":"20611","inReplyTo":"1250375997-10657-3-git-send-email-gitster@pobox.com","subject":"[PATCH 3/9] git stat: the beginning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-15T22:39:51Z","receivedAt":"2009-08-15T22:39:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tentatively add \"git stat\" as a new command.  This does not munge the\nindex with paths parameters before showing the status like \"git status\"\ndoes.  In later rounds, we will take path parameters as pathspec to limit\nthe output.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Unchanged since the last round.\n\n Makefile         |    1 +\n builtin-commit.c |   64 +++++++++++++++++++++++++++++++++++++++++++++--------\n builtin.h        |    1 +\n git.c            |    1 +\n wt-status.c      |   23 +++++++++++-------\n wt-status.h      |    1 +\n 6 files changed, 72 insertions(+), 19 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex daf4296..39dd334 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -378,6 +378,7 @@ BUILT_INS += git-init$X\n BUILT_INS += git-merge-subtree$X\n BUILT_INS += git-peek-remote$X\n BUILT_INS += git-repo-config$X\n+BUILT_INS += git-stat$X\n BUILT_INS += git-show$X\n BUILT_INS += git-stage$X\n BUILT_INS += git-status$X\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 200ffda..0ef7c8f 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -24,6 +24,7 @@\n #include \"string-list.h\"\n #include \"rerere.h\"\n #include \"unpack-trees.h\"\n+#include \"quote.h\"\n \n static const char * const builtin_commit_usage[] = {\n \t\"git commit [options] [--] <filepattern>...\",\n@@ -35,6 +36,11 @@ static const char * const builtin_status_usage[] = {\n \tNULL\n };\n \n+static const char * const builtin_stat_usage[] = {\n+\t\"git stat [options]\",\n+\tNULL\n+};\n+\n static unsigned char head_sha1[20], merge_head_sha1[20];\n static char *use_message_buffer;\n static const char commit_editmsg[] = \"COMMIT_EDITMSG\";\n@@ -691,6 +697,21 @@ static const char *find_author_by_nickname(const char *name)\n \tdie(\"No existing author found with '%s'\", name);\n }\n \n+\n+static void handle_untracked_files_arg(struct wt_status *s)\n+{\n+\tif (!untracked_files_arg)\n+\t\t; /* default already initialized */\n+\telse if (!strcmp(untracked_files_arg, \"no\"))\n+\t\ts->show_untracked_files = SHOW_NO_UNTRACKED_FILES;\n+\telse if (!strcmp(untracked_files_arg, \"normal\"))\n+\t\ts->show_untracked_files = SHOW_NORMAL_UNTRACKED_FILES;\n+\telse if (!strcmp(untracked_files_arg, \"all\"))\n+\t\ts->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;\n+\telse\n+\t\tdie(\"Invalid untracked files mode '%s'\", untracked_files_arg);\n+}\n+\n static int parse_and_validate_options(int argc, const char *argv[],\n \t\t\t\t      const char * const usage[],\n \t\t\t\t      const char *prefix,\n@@ -794,16 +815,7 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \telse\n \t\tdie(\"Invalid cleanup mode %s\", cleanup_arg);\n \n-\tif (!untracked_files_arg)\n-\t\t; /* default already initialized */\n-\telse if (!strcmp(untracked_files_arg, \"no\"))\n-\t\ts->show_untracked_files = SHOW_NO_UNTRACKED_FILES;\n-\telse if (!strcmp(untracked_files_arg, \"normal\"))\n-\t\ts->show_untracked_files = SHOW_NORMAL_UNTRACKED_FILES;\n-\telse if (!strcmp(untracked_files_arg, \"all\"))\n-\t\ts->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;\n-\telse\n-\t\tdie(\"Invalid untracked files mode '%s'\", untracked_files_arg);\n+\thandle_untracked_files_arg(s);\n \n \tif (all && argc > 0)\n \t\tdie(\"Paths with -a does not make sense.\");\n@@ -886,6 +898,38 @@ static int git_status_config(const char *k, const char *v, void *cb)\n \treturn git_diff_ui_config(k, v, NULL);\n }\n \n+int cmd_stat(int argc, const char **argv, const char *prefix)\n+{\n+\tstruct wt_status s;\n+\tunsigned char sha1[20];\n+\tstatic struct option builtin_stat_options[] = {\n+\t\t{ OPTION_STRING, 'u', \"untracked-files\", &untracked_files_arg,\n+\t\t  \"mode\",\n+\t\t  \"show untracked files, optional modes: all, normal, no. (Default: all)\",\n+\t\t  PARSE_OPT_OPTARG, NULL, (intptr_t)\"all\" },\n+\t\tOPT_END(),\n+\t};\n+\n+\twt_status_prepare(&s);\n+\tgit_config(git_status_config, &s);\n+\targc = parse_options(argc, argv, prefix,\n+\t\t\t     builtin_stat_options,\n+\t\t\t     builtin_stat_usage, 0);\n+\thandle_untracked_files_arg(&s);\n+\n+\tread_cache();\n+\trefresh_cache(REFRESH_QUIET|REFRESH_UNMERGED);\n+\ts.is_initial = get_sha1(s.reference, sha1) ? 1 : 0;\n+\twt_status_collect(&s);\n+\n+\tif (s.use_color == -1)\n+\t\ts.use_color = git_use_color_default;\n+\tif (diff_use_color_default == -1)\n+\t\tdiff_use_color_default = git_use_color_default;\n+\twt_status_print_body(&s);\n+\treturn 0;\n+}\n+\n int cmd_status(int argc, const char **argv, const char *prefix)\n {\n \tstruct wt_status s;\ndiff --git a/builtin.h b/builtin.h\nindex 20427d2..eeaf0b6 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -95,6 +95,7 @@ extern int cmd_send_pack(int argc, const char **argv, const char *prefix);\n extern int cmd_shortlog(int argc, const char **argv, const char *prefix);\n extern int cmd_show(int argc, const char **argv, const char *prefix);\n extern int cmd_show_branch(int argc, const char **argv, const char *prefix);\n+extern int cmd_stat(int argc, const char **argv, const char *prefix);\n extern int cmd_status(int argc, const char **argv, const char *prefix);\n extern int cmd_stripspace(int argc, const char **argv, const char *prefix);\n extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);\ndiff --git a/git.c b/git.c\nindex 807d875..de7fcf6 100644\n--- a/git.c\n+++ b/git.c\n@@ -350,6 +350,7 @@ static void handle_internal_command(int argc, const char **argv)\n \t\t{ \"shortlog\", cmd_shortlog, USE_PAGER },\n \t\t{ \"show-branch\", cmd_show_branch, RUN_SETUP },\n \t\t{ \"show\", cmd_show, RUN_SETUP | USE_PAGER },\n+\t\t{ \"stat\", cmd_stat, RUN_SETUP | NEED_WORK_TREE },\n \t\t{ \"status\", cmd_status, RUN_SETUP | NEED_WORK_TREE },\n \t\t{ \"stripspace\", cmd_stripspace },\n \t\t{ \"symbolic-ref\", cmd_symbolic_ref, RUN_SETUP },\ndiff --git a/wt-status.c b/wt-status.c\nindex 63598ce..c887a90 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -531,6 +531,19 @@ static void wt_status_print_tracking(struct wt_status *s)\n \tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"#\");\n }\n \n+void wt_status_print_body(struct wt_status *s)\n+{\n+\twt_status_print_unmerged(s);\n+\twt_status_print_updated(s);\n+\twt_status_print_changed(s);\n+\tif (s->submodule_summary)\n+\t\twt_status_print_submodule_summary(s);\n+\tif (s->show_untracked_files)\n+\t\twt_status_print_untracked(s);\n+\telse if (s->commitable)\n+\t\t fprintf(s->fp, \"# Untracked files not listed (use -u option to show untracked files)\\n\");\n+}\n+\n void wt_status_print(struct wt_status *s)\n {\n \tunsigned char sha1[20];\n@@ -561,15 +574,7 @@ void wt_status_print(struct wt_status *s)\n \t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"#\");\n \t}\n \n-\twt_status_print_unmerged(s);\n-\twt_status_print_updated(s);\n-\twt_status_print_changed(s);\n-\tif (s->submodule_summary)\n-\t\twt_status_print_submodule_summary(s);\n-\tif (s->show_untracked_files)\n-\t\twt_status_print_untracked(s);\n-\telse if (s->commitable)\n-\t\t fprintf(s->fp, \"# Untracked files not listed (use -u option to show untracked files)\\n\");\n+\twt_status_print_body(s);\n \n \tif (s->verbose)\n \t\twt_status_print_verbose(s);\ndiff --git a/wt-status.h b/wt-status.h\nindex a0e7517..ab52ce1 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -54,5 +54,6 @@ struct wt_status {\n void wt_status_prepare(struct wt_status *s);\n void wt_status_print(struct wt_status *s);\n void wt_status_collect(struct wt_status *s);\n+void wt_status_print_body(struct wt_status *s);\n \n #endif /* STATUS_H */\n-- \n1.6.4.224.g3be84\n"},{"id":"120744","messageId":"1250375997-10657-5-git-send-email-gitster@pobox.com","threadId":"20611","inReplyTo":"1250375997-10657-4-git-send-email-gitster@pobox.com","subject":"[PATCH 4/9] git stat: honor relative paths setting","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-15T22:39:52Z","receivedAt":"2009-08-15T22:39:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When run from a subdirectory, by default (and when status.relativepaths is\nset), we should pass it to wt_status_print_body()\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Fix-up to 3/9; will be squashed in the final round.\n\n builtin-commit.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 0ef7c8f..7120876 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -922,6 +922,8 @@ int cmd_stat(int argc, const char **argv, const char *prefix)\n \ts.is_initial = get_sha1(s.reference, sha1) ? 1 : 0;\n \twt_status_collect(&s);\n \n+\tif (s.relative_paths)\n+\t\ts.prefix = prefix;\n \tif (s.use_color == -1)\n \t\ts.use_color = git_use_color_default;\n \tif (diff_use_color_default == -1)\n-- \n1.6.4.224.g3be84\n"},{"id":"120748","messageId":"1250375997-10657-6-git-send-email-gitster@pobox.com","threadId":"20611","inReplyTo":"1250375997-10657-5-git-send-email-gitster@pobox.com","subject":"[PATCH 5/9] git stat: show traditional status headers and trailers as well","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-15T22:39:53Z","receivedAt":"2009-08-15T22:39:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Also honor -v to show the \"diff --cached\" output.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Fix-up to 3/9; will be squashed in the final round to remove the trace\n   of ill conceived wt_status_print_body() refactoring.\n\n builtin-commit.c |    8 +++++++-\n wt-status.c      |   27 +++++++++------------------\n wt-status.h      |    1 -\n 3 files changed, 16 insertions(+), 20 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 7120876..8db0365 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -352,6 +352,8 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n static int run_status(FILE *fp, const char *index_file, const char *prefix, int nowarn,\n \t\t      struct wt_status *s)\n {\n+\tunsigned char sha1[20];\n+\n \tif (s->relative_paths)\n \t\ts->prefix = prefix;\n \n@@ -363,7 +365,9 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int\n \ts->index_file = index_file;\n \ts->fp = fp;\n \ts->nowarn = nowarn;\n+\ts->is_initial = get_sha1(s->reference, sha1) ? 1 : 0;\n \n+\twt_status_collect(s);\n \twt_status_print(s);\n \n \treturn s->commitable;\n@@ -903,6 +907,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix)\n \tstruct wt_status s;\n \tunsigned char sha1[20];\n \tstatic struct option builtin_stat_options[] = {\n+\t\tOPT__VERBOSE(&verbose),\n \t\t{ OPTION_STRING, 'u', \"untracked-files\", &untracked_files_arg,\n \t\t  \"mode\",\n \t\t  \"show untracked files, optional modes: all, normal, no. (Default: all)\",\n@@ -922,13 +927,14 @@ int cmd_stat(int argc, const char **argv, const char *prefix)\n \ts.is_initial = get_sha1(s.reference, sha1) ? 1 : 0;\n \twt_status_collect(&s);\n \n+\ts.verbose = verbose;\n \tif (s.relative_paths)\n \t\ts.prefix = prefix;\n \tif (s.use_color == -1)\n \t\ts.use_color = git_use_color_default;\n \tif (diff_use_color_default == -1)\n \t\tdiff_use_color_default = git_use_color_default;\n-\twt_status_print_body(&s);\n+\twt_status_print(&s);\n \treturn 0;\n }\n \ndiff --git a/wt-status.c b/wt-status.c\nindex c887a90..c55be53 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -531,25 +531,10 @@ static void wt_status_print_tracking(struct wt_status *s)\n \tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"#\");\n }\n \n-void wt_status_print_body(struct wt_status *s)\n-{\n-\twt_status_print_unmerged(s);\n-\twt_status_print_updated(s);\n-\twt_status_print_changed(s);\n-\tif (s->submodule_summary)\n-\t\twt_status_print_submodule_summary(s);\n-\tif (s->show_untracked_files)\n-\t\twt_status_print_untracked(s);\n-\telse if (s->commitable)\n-\t\t fprintf(s->fp, \"# Untracked files not listed (use -u option to show untracked files)\\n\");\n-}\n-\n void wt_status_print(struct wt_status *s)\n {\n-\tunsigned char sha1[20];\n \tconst char *branch_color = color(WT_STATUS_HEADER, s);\n \n-\ts->is_initial = get_sha1(s->reference, sha1) ? 1 : 0;\n \tif (s->branch) {\n \t\tconst char *on_what = \"On branch \";\n \t\tconst char *branch_name = s->branch;\n@@ -566,15 +551,21 @@ void wt_status_print(struct wt_status *s)\n \t\t\twt_status_print_tracking(s);\n \t}\n \n-\twt_status_collect(s);\n-\n \tif (s->is_initial) {\n \t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"#\");\n \t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"# Initial commit\");\n \t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"#\");\n \t}\n \n-\twt_status_print_body(s);\n+\twt_status_print_unmerged(s);\n+\twt_status_print_updated(s);\n+\twt_status_print_changed(s);\n+\tif (s->submodule_summary)\n+\t\twt_status_print_submodule_summary(s);\n+\tif (s->show_untracked_files)\n+\t\twt_status_print_untracked(s);\n+\telse if (s->commitable)\n+\t\t fprintf(s->fp, \"# Untracked files not listed (use -u option to show untracked files)\\n\");\n \n \tif (s->verbose)\n \t\twt_status_print_verbose(s);\ndiff --git a/wt-status.h b/wt-status.h\nindex ab52ce1..a0e7517 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -54,6 +54,5 @@ struct wt_status {\n void wt_status_prepare(struct wt_status *s);\n void wt_status_print(struct wt_status *s);\n void wt_status_collect(struct wt_status *s);\n-void wt_status_print_body(struct wt_status *s);\n \n #endif /* STATUS_H */\n-- \n1.6.4.224.g3be84\n"},{"id":"120746","messageId":"1250375997-10657-7-git-send-email-gitster@pobox.com","threadId":"20611","inReplyTo":"1250375997-10657-6-git-send-email-gitster@pobox.com","subject":"[PATCH 6/9] git stat: pathspec limits, unlike traditional \"git status\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-15T22:39:54Z","receivedAt":"2009-08-15T22:39:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The \"git stat\" command is not \"preview of commit with the same arguments\";\nthe path parameters are not paths to be added to the pristine index (aka\n\"--only\" option), but are taken as pathspecs to limit the output.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Fix-up to 3/9; will be squashed in the final round.\n\n builtin-commit.c |    3 +++\n wt-status.c      |    6 ++++++\n wt-status.h      |    1 +\n 3 files changed, 10 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 8db0365..5e23ef1 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -922,6 +922,9 @@ int cmd_stat(int argc, const char **argv, const char *prefix)\n \t\t\t     builtin_stat_usage, 0);\n \thandle_untracked_files_arg(&s);\n \n+\tif (*argv)\n+\t\ts.pathspec = get_pathspec(prefix, argv);\n+\n \tread_cache();\n \trefresh_cache(REFRESH_QUIET|REFRESH_UNMERGED);\n \ts.is_initial = get_sha1(s.reference, sha1) ? 1 : 0;\ndiff --git a/wt-status.c b/wt-status.c\nindex c55be53..249227c 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -269,6 +269,7 @@ static void wt_status_collect_changes_worktree(struct wt_status *s)\n \trev.diffopt.output_format |= DIFF_FORMAT_CALLBACK;\n \trev.diffopt.format_callback = wt_status_collect_changed_cb;\n \trev.diffopt.format_callback_data = s;\n+\trev.prune_data = s->pathspec;\n \trun_diff_files(&rev, 0);\n }\n \n@@ -285,6 +286,7 @@ static void wt_status_collect_changes_index(struct wt_status *s)\n \trev.diffopt.detect_rename = 1;\n \trev.diffopt.rename_limit = 200;\n \trev.diffopt.break_opt = 0;\n+\trev.prune_data = s->pathspec;\n \trun_diff_index(&rev, 1);\n }\n \n@@ -297,6 +299,8 @@ static void wt_status_collect_changes_initial(struct wt_status *s)\n \t\tstruct wt_status_change_data *d;\n \t\tstruct cache_entry *ce = active_cache[i];\n \n+\t\tif (!ce_path_match(ce, s->pathspec))\n+\t\t\tcontinue;\n \t\tit = string_list_insert(ce->name, &s->change);\n \t\td = it->util;\n \t\tif (!d) {\n@@ -330,6 +334,8 @@ static void wt_status_collect_untracked(struct wt_status *s)\n \t\tstruct dir_entry *ent = dir.entries[i];\n \t\tif (!cache_name_is_other(ent->name, ent->len))\n \t\t\tcontinue;\n+\t\tif (!match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL))\n+\t\t\tcontinue;\n \t\ts->workdir_untracked = 1;\n \t\tstring_list_insert(ent->name, &s->untracked);\n \t}\ndiff --git a/wt-status.h b/wt-status.h\nindex a0e7517..09fd9f1 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -31,6 +31,7 @@ struct wt_status {\n \tint is_initial;\n \tchar *branch;\n \tconst char *reference;\n+\tconst char **pathspec;\n \tint verbose;\n \tint amend;\n \tint nowarn;\n-- \n1.6.4.224.g3be84\n"},{"id":"120750","messageId":"1250375997-10657-8-git-send-email-gitster@pobox.com","threadId":"20611","inReplyTo":"1250375997-10657-7-git-send-email-gitster@pobox.com","subject":"[PATCH 7/9] git stat -s: short status output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-15T22:39:55Z","receivedAt":"2009-08-15T22:39:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Give -s(hort) option to \"git stat\" that shows the status of paths in a\nmore concise way.\n\n    XY PATH1 -> PATH2\n\nformat to be more machine readable than output from \"git status\", which is\nabout previewing of \"git commit\" with the same arguments.\n\nPATH1 is the path in the HEAD, and \" -> PATH2\" part is shown only when\nPATH1 corresponds to a different path in the index/worktree.\n\nFor unmerged entries, X shows the status of stage #2 (i.e. ours) and Y\nshows the status of stage #3 (i.e. theirs).  For entries that do not have\nconflicts, X shows the status of the index, and Y shows the status of the\nwork tree.  For untracked paths, XY are \"??\".\n\n    X          Y     Meaning\n    -------------------------------------------------\n              [MD]   not updated\n    M        [ MD]   updated in index\n    A        [ MD]   added to index\n    D        [ MD]   deleted from index\n    R        [ MD]   renamed in index\n    C        [ MD]   copied in index\n    [MARC]           index and work tree matches\n    [ MARC]     M    work tree changed since index\n    [ MARC]     D    deleted in work tree\n\n    D           D    unmerged, both deleted\n    A           U    unmerged, added by us\n    U           D    unmerged, deleted by them\n    U           A    unmerged, added by them\n    D           U    unmerged, deleted by us\n    A           A    unmerged, both added\n    U           U    unmerged, both modified\n\n    ?           ?    untracked\n\nWhen given -z option, the records are terminated by NUL characters for\nbetter machine readability.  Because the traditional long format is\ndesigned for human consumption, NUL termination does not make sense.\nFor this reason, -z option implies -s (short output).\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Unchanged since the last round; rebased on top of the updated code to\n   support the long format output.\n\n builtin-commit.c |  114 ++++++++++++++++++++++++++++++++++++++++++++++++++----\n 1 files changed, 106 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 5e23ef1..1a360cb 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -902,12 +902,87 @@ static int git_status_config(const char *k, const char *v, void *cb)\n \treturn git_diff_ui_config(k, v, NULL);\n }\n \n+#define quote_path quote_path_relative\n+\n+static void short_unmerged(int null_termination, struct string_list_item *it,\n+\t\t\t   struct wt_status *s)\n+{\n+\tstruct wt_status_change_data *d = it->util;\n+\tconst char *how = \"??\";\n+\n+\tswitch (d->stagemask) {\n+\tcase 1: how = \"DD\"; break; /* both deleted */\n+\tcase 2: how = \"AU\"; break; /* added by us */\n+\tcase 3: how = \"UD\"; break; /* deleted by them */\n+\tcase 4: how = \"UA\"; break; /* added by them */\n+\tcase 5: how = \"DU\"; break; /* deleted by us */\n+\tcase 6: how = \"AA\"; break; /* both added */\n+\tcase 7: how = \"UU\"; break; /* both modified */\n+\t}\n+\tprintf(\"%s \", how);\n+\tif (null_termination) {\n+\t\tfprintf(stdout, \"%s%c\", it->string, 0);\n+\t} else {\n+\t\tstruct strbuf onebuf = STRBUF_INIT;\n+\t\tconst char *one;\n+\t\tone = quote_path(it->string, -1, &onebuf, s->prefix);\n+\t\tprintf(\"%s\\n\", one);\n+\t\tstrbuf_release(&onebuf);\n+\t}\n+}\n+\n+static void short_status(int null_termination, struct string_list_item *it,\n+\t\t\t struct wt_status *s)\n+{\n+\tstruct wt_status_change_data *d = it->util;\n+\n+\tprintf(\"%c%c \",\n+\t       !d->index_status ? ' ' : d->index_status,\n+\t       !d->worktree_status ? ' ' : d->worktree_status);\n+\tif (null_termination) {\n+\t\tfprintf(stdout, \"%s%c\", it->string, 0);\n+\t\tif (d->head_path)\n+\t\t\tfprintf(stdout, \"%s%c\", d->head_path, 0);\n+\t} else {\n+\t\tstruct strbuf onebuf = STRBUF_INIT;\n+\t\tconst char *one;\n+\t\tif (d->head_path) {\n+\t\t\tone = quote_path(d->head_path, -1, &onebuf, s->prefix);\n+\t\t\tprintf(\"%s -> \", one);\n+\t\t\tstrbuf_release(&onebuf);\n+\t\t}\n+\t\tone = quote_path(it->string, -1, &onebuf, s->prefix);\n+\t\tprintf(\"%s\\n\", one);\n+\t\tstrbuf_release(&onebuf);\n+\t}\n+}\n+\n+static void short_untracked(int null_termination, struct string_list_item *it,\n+\t\t\t    struct wt_status *s)\n+{\n+\tif (null_termination) {\n+\t\tfprintf(stdout, \"?? %s%c\", it->string, 0);\n+\t} else {\n+\t\tstruct strbuf onebuf = STRBUF_INIT;\n+\t\tconst char *one;\n+\t\tone = quote_path(it->string, -1, &onebuf, s->prefix);\n+\t\tprintf(\"?? %s\\n\", one);\n+\t\tstrbuf_release(&onebuf);\n+\t}\n+}\n+\n int cmd_stat(int argc, const char **argv, const char *prefix)\n {\n \tstruct wt_status s;\n+\tstatic int null_termination, shortstatus;\n+\tint i;\n \tunsigned char sha1[20];\n \tstatic struct option builtin_stat_options[] = {\n \t\tOPT__VERBOSE(&verbose),\n+\t\tOPT_BOOLEAN('s', \"short\", &shortstatus,\n+\t\t\t    \"show status concicely\"),\n+\t\tOPT_BOOLEAN('z', \"null\", &null_termination,\n+\t\t\t    \"terminate entries with NUL\"),\n \t\t{ OPTION_STRING, 'u', \"untracked-files\", &untracked_files_arg,\n \t\t  \"mode\",\n \t\t  \"show untracked files, optional modes: all, normal, no. (Default: all)\",\n@@ -915,6 +990,9 @@ int cmd_stat(int argc, const char **argv, const char *prefix)\n \t\tOPT_END(),\n \t};\n \n+\tif (null_termination)\n+\t\tshortstatus = 1;\n+\n \twt_status_prepare(&s);\n \tgit_config(git_status_config, &s);\n \targc = parse_options(argc, argv, prefix,\n@@ -930,14 +1008,34 @@ int cmd_stat(int argc, const char **argv, const char *prefix)\n \ts.is_initial = get_sha1(s.reference, sha1) ? 1 : 0;\n \twt_status_collect(&s);\n \n-\ts.verbose = verbose;\n-\tif (s.relative_paths)\n-\t\ts.prefix = prefix;\n-\tif (s.use_color == -1)\n-\t\ts.use_color = git_use_color_default;\n-\tif (diff_use_color_default == -1)\n-\t\tdiff_use_color_default = git_use_color_default;\n-\twt_status_print(&s);\n+\tif (shortstatus) {\n+\t\tfor (i = 0; i < s.change.nr; i++) {\n+\t\t\tstruct wt_status_change_data *d;\n+\t\t\tstruct string_list_item *it;\n+\n+\t\t\tit = &(s.change.items[i]);\n+\t\t\td = it->util;\n+\t\t\tif (d->stagemask)\n+\t\t\t\tshort_unmerged(null_termination, it, &s);\n+\t\t\telse\n+\t\t\t\tshort_status(null_termination, it, &s);\n+\t\t}\n+\t\tfor (i = 0; i < s.untracked.nr; i++) {\n+\t\t\tstruct string_list_item *it;\n+\n+\t\t\tit = &(s.untracked.items[i]);\n+\t\t\tshort_untracked(null_termination, it, &s);\n+\t\t}\n+\t} else {\n+\t\ts.verbose = verbose;\n+\t\tif (s.relative_paths)\n+\t\t\ts.prefix = prefix;\n+\t\tif (s.use_color == -1)\n+\t\t\ts.use_color = git_use_color_default;\n+\t\tif (diff_use_color_default == -1)\n+\t\t\tdiff_use_color_default = git_use_color_default;\n+\t\twt_status_print(&s);\n+\t}\n \treturn 0;\n }\n \n-- \n1.6.4.224.g3be84\n"},{"id":"120747","messageId":"1250375997-10657-9-git-send-email-gitster@pobox.com","threadId":"20611","inReplyTo":"1250375997-10657-8-git-send-email-gitster@pobox.com","subject":"[PATCH 8/9] git status: not \"commit --dry-run\" anymore","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-15T22:39:56Z","receivedAt":"2009-08-15T22:39:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This removes tentative \"git stat\" and make it take over \"git status\".\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * This alone fails some tests; 9/9 will be squashed in in the final round.\n\n Documentation/git-status.txt |   79 ++++++++++++++++++++++++++++++++++++-----\n builtin-commit.c             |   29 ++-------------\n builtin.h                    |    1 -\n git.c                        |    1 -\n 4 files changed, 73 insertions(+), 37 deletions(-)\n\ndiff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\nindex 84f60f3..b5939d6 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' [<options>...] [--] [<pathspec>...]\n \n DESCRIPTION\n -----------\n@@ -20,25 +20,85 @@ are what you _would_ commit by running `git commit`; the second and\n third are what you _could_ commit by running 'git-add' before running\n `git commit`.\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 there is no path that is different between the index file and\n-the current HEAD commit (i.e., there is nothing to commit by running\n-`git commit`), the command exits with non-zero status.\n+OPTIONS\n+-------\n+\n+-s::\n+--short::\n+\tGive the output in the short-format.\n+\n+-u[<mode>]::\n+--untracked-files[=<mode>]::\n+\tShow untracked files (Default: 'all').\n++\n+The mode parameter is optional, and is used to specify\n+the handling of untracked files. The possible options are:\n++\n+--\n+\t- 'no'     - Show no untracked files\n+\t- 'normal' - Shows untracked files and directories\n+\t- 'all'    - Also shows individual files in untracked directories.\n+--\n++\n+See linkgit:git-config[1] for configuration variable\n+used to change the default for when the option is not\n+specified.\n+\n+-z::\n+\tTerminate entries with NUL, instead of LF.  This implies `-s`\n+\t(short status) output format.\n \n \n OUTPUT\n ------\n The output from this command is designed to be used as a commit\n template comment, and all the output lines are prefixed with '#'.\n+The default, long format, is designed to be human readable,\n+verbose and descriptive.  They are subject to change in any time.\n \n The paths mentioned in the output, unlike many other git commands, are\n made relative to the current directory if you are working in a\n subdirectory (this is on purpose, to help cutting and pasting). See\n the status.relativePaths config option below.\n \n+In short-format, the status of each path is shown as\n+\n+\tXY PATH1 -> PATH2\n+\n+where `PATH1` is the path in the `HEAD`, and ` -> PATH2` part is\n+shown only when `PATH1` corresponds to a different path in the\n+index/worktree (i.e. renamed).\n+\n+For unmerged entries, `X` shows the status of stage #2 (i.e. ours) and `Y`\n+shows the status of stage #3 (i.e. theirs).\n+\n+For entries that do not have conflicts, `X` shows the status of the index,\n+and `Y` shows the status of the work tree.  For untracked paths, `XY` are\n+`??`.\n+\n+    X          Y     Meaning\n+    -------------------------------------------------\n+              [MD]   not updated\n+    M        [ MD]   updated in index\n+    A        [ MD]   added to index\n+    D        [ MD]   deleted from index\n+    R        [ MD]   renamed in index\n+    C        [ MD]   copied in index\n+    [MARC]           index and work tree matches\n+    [ MARC]     M    work tree changed since index\n+    [ MARC]     D    deleted in work tree\n+    -------------------------------------------------\n+    D           D    unmerged, both deleted\n+    A           U    unmerged, added by us\n+    U           D    unmerged, deleted by them\n+    U           A    unmerged, added by them\n+    D           U    unmerged, deleted by us\n+    A           A    unmerged, both added\n+    U           U    unmerged, both modified\n+    -------------------------------------------------\n+    ?           ?    untracked\n+    -------------------------------------------------\n+\n \n CONFIGURATION\n -------------\n@@ -63,8 +123,7 @@ linkgit:gitignore[5]\n \n Author\n ------\n-Written by Linus Torvalds <torvalds@osdl.org> and\n-Junio C Hamano <gitster@pobox.com>.\n+Written by Junio C Hamano <gitster@pobox.com>.\n \n Documentation\n --------------\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 1a360cb..6cb0e40 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -36,11 +36,6 @@ static const char * const builtin_status_usage[] = {\n \tNULL\n };\n \n-static const char * const builtin_stat_usage[] = {\n-\t\"git stat [options]\",\n-\tNULL\n-};\n-\n static unsigned char head_sha1[20], merge_head_sha1[20];\n static char *use_message_buffer;\n static const char commit_editmsg[] = \"COMMIT_EDITMSG\";\n@@ -971,13 +966,13 @@ static void short_untracked(int null_termination, struct string_list_item *it,\n \t}\n }\n \n-int cmd_stat(int argc, const char **argv, const char *prefix)\n+int cmd_status(int argc, const char **argv, const char *prefix)\n {\n \tstruct wt_status s;\n \tstatic int null_termination, shortstatus;\n \tint i;\n \tunsigned char sha1[20];\n-\tstatic struct option builtin_stat_options[] = {\n+\tstatic struct option builtin_status_options[] = {\n \t\tOPT__VERBOSE(&verbose),\n \t\tOPT_BOOLEAN('s', \"short\", &shortstatus,\n \t\t\t    \"show status concicely\"),\n@@ -996,8 +991,8 @@ int cmd_stat(int argc, const char **argv, const char *prefix)\n \twt_status_prepare(&s);\n \tgit_config(git_status_config, &s);\n \targc = parse_options(argc, argv, prefix,\n-\t\t\t     builtin_stat_options,\n-\t\t\t     builtin_stat_usage, 0);\n+\t\t\t     builtin_status_options,\n+\t\t\t     builtin_status_usage, 0);\n \thandle_untracked_files_arg(&s);\n \n \tif (*argv)\n@@ -1039,22 +1034,6 @@ int cmd_stat(int argc, const char **argv, const char *prefix)\n \treturn 0;\n }\n \n-int cmd_status(int argc, const char **argv, const char *prefix)\n-{\n-\tstruct wt_status s;\n-\n-\twt_status_prepare(&s);\n-\tgit_config(git_status_config, &s);\n-\tif (s.use_color == -1)\n-\t\ts.use_color = git_use_color_default;\n-\tif (diff_use_color_default == -1)\n-\t\tdiff_use_color_default = git_use_color_default;\n-\n-\targc = parse_and_validate_options(argc, argv, builtin_status_usage,\n-\t\t\t\t\t  prefix, &s);\n-\treturn dry_run_commit(argc, argv, prefix, &s);\n-}\n-\n static void print_summary(const char *prefix, const unsigned char *sha1)\n {\n \tstruct rev_info rev;\ndiff --git a/builtin.h b/builtin.h\nindex eeaf0b6..20427d2 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -95,7 +95,6 @@ extern int cmd_send_pack(int argc, const char **argv, const char *prefix);\n extern int cmd_shortlog(int argc, const char **argv, const char *prefix);\n extern int cmd_show(int argc, const char **argv, const char *prefix);\n extern int cmd_show_branch(int argc, const char **argv, const char *prefix);\n-extern int cmd_stat(int argc, const char **argv, const char *prefix);\n extern int cmd_status(int argc, const char **argv, const char *prefix);\n extern int cmd_stripspace(int argc, const char **argv, const char *prefix);\n extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);\ndiff --git a/git.c b/git.c\nindex de7fcf6..807d875 100644\n--- a/git.c\n+++ b/git.c\n@@ -350,7 +350,6 @@ static void handle_internal_command(int argc, const char **argv)\n \t\t{ \"shortlog\", cmd_shortlog, USE_PAGER },\n \t\t{ \"show-branch\", cmd_show_branch, RUN_SETUP },\n \t\t{ \"show\", cmd_show, RUN_SETUP | USE_PAGER },\n-\t\t{ \"stat\", cmd_stat, RUN_SETUP | NEED_WORK_TREE },\n \t\t{ \"status\", cmd_status, RUN_SETUP | NEED_WORK_TREE },\n \t\t{ \"stripspace\", cmd_stripspace },\n \t\t{ \"symbolic-ref\", cmd_symbolic_ref, RUN_SETUP },\n-- \n1.6.4.224.g3be84\n"},{"id":"120749","messageId":"1250375997-10657-10-git-send-email-gitster@pobox.com","threadId":"20611","inReplyTo":"1250375997-10657-9-git-send-email-gitster@pobox.com","subject":"[PATCH 9/9] git-status: adjust tests","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-15T22:39:57Z","receivedAt":"2009-08-15T22:39:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"There are some tests that expect \"git status\" to exit with non-zero status\nwhen there is something staged.  Some tests expect \"git status path...\" to\nshow the status for a partial commit.\n\nFor these, replace \"git status\" with \"git commit --dry-run\".  For the\nones that do not attempt a dry-run of a partial commit that check the\noutput from the command, check the output from \"git status\" as well, as\nthey should be identical.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Kept separate for easier review; shows the extent of damage from the\n   change in semantics rather well.\n\n t/t6040-tracking-info.sh    |    2 +-\n t/t7060-wtstatus.sh         |    8 +++++---\n t/t7506-status-submodule.sh |    6 +++---\n t/t7508-status.sh           |   12 +++++++-----\n 4 files changed, 16 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh\nindex 00e1de9..664b0f8 100755\n--- a/t/t6040-tracking-info.sh\n+++ b/t/t6040-tracking-info.sh\n@@ -69,7 +69,7 @@ test_expect_success 'status' '\n \t\tcd test &&\n \t\tgit checkout b1 >/dev/null &&\n \t\t# reports nothing to commit\n-\t\ttest_must_fail git status\n+\t\ttest_must_fail git commit --dry-run\n \t) >actual &&\n \tgrep \"have 1 and 1 different\" actual\n '\ndiff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh\nindex 1044aa6..7b5db80 100755\n--- a/t/t7060-wtstatus.sh\n+++ b/t/t7060-wtstatus.sh\n@@ -50,9 +50,11 @@ test_expect_success 'M/D conflict does not segfault' '\n \t\tgit rm foo &&\n \t\tgit commit -m delete &&\n \t\ttest_must_fail git merge master &&\n-\t\ttest_must_fail git status > ../actual\n-\t) &&\n-\ttest_cmp expect actual\n+\t\ttest_must_fail git commit --dry-run >../actual &&\n+\t\ttest_cmp ../expect ../actual &&\n+\t\tgit status >../actual &&\n+\t\ttest_cmp ../expect ../actual\n+\t)\n '\n \n test_done\ndiff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh\nindex d9a08aa..3ca17ab 100755\n--- a/t/t7506-status-submodule.sh\n+++ b/t/t7506-status-submodule.sh\n@@ -19,8 +19,8 @@ test_expect_success 'status clean' '\n \tgit status |\n \tgrep \"nothing to commit\"\n '\n-test_expect_success 'status -a clean' '\n-\tgit status -a |\n+test_expect_success 'commit --dry-run -a clean' '\n+\tgit commit --dry-run -a |\n \tgrep \"nothing to commit\"\n '\n test_expect_success 'rm submodule contents' '\n@@ -31,7 +31,7 @@ test_expect_success 'status clean (empty submodule dir)' '\n \tgrep \"nothing to commit\"\n '\n test_expect_success 'status -a clean (empty submodule dir)' '\n-\tgit status -a |\n+\tgit commit --dry-run -a |\n \tgrep \"nothing to commit\"\n '\n \ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 93f875f..1173dbb 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -248,8 +248,8 @@ cat <<EOF >expect\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'status of partial commit excluding new file in index' '\n-\tgit status dir1/modified >output &&\n+test_expect_success 'dry-run of partial commit excluding new file in index' '\n+\tgit commit --dry-run dir1/modified >output &&\n \ttest_cmp expect output\n '\n \n@@ -358,7 +358,9 @@ EOF\n test_expect_success 'status submodule summary (clean submodule)' '\n \tgit commit -m \"commit submodule\" &&\n \tgit config status.submodulesummary 10 &&\n-\ttest_must_fail git status >output &&\n+\ttest_must_fail git commit --dry-run >output &&\n+\ttest_cmp expect output &&\n+\tgit status >output &&\n \ttest_cmp expect output\n '\n \n@@ -391,9 +393,9 @@ cat >expect <<EOF\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'status submodule summary (--amend)' '\n+test_expect_success 'commit --dry-run submodule summary (--amend)' '\n \tgit config status.submodulesummary 10 &&\n-\tgit status --amend >output &&\n+\tgit commit --dry-run --amend >output &&\n \ttest_cmp expect output\n '\n \n-- \n1.6.4.224.g3be84\n"},{"id":"120850","messageId":"200908171057.27455.trast@student.ethz.ch","threadId":"20611","inReplyTo":"1250375997-10657-9-git-send-email-gitster@pobox.com","subject":"Re: [PATCH 8/9] git status: not \"commit --dry-run\" anymore","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-08-17T08:57:26Z","receivedAt":"2009-08-17T08:57:26Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Junio C Hamano wrote:\n> This removes tentative \"git stat\" and make it take over \"git status\".\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n> \n>  * This alone fails some tests; 9/9 will be squashed in in the final round.\n> \n>  Documentation/git-status.txt |   79 ++++++++++++++++++++++++++++++++++++-----\n>  builtin-commit.c             |   29 ++-------------\n>  builtin.h                    |    1 -\n>  git.c                        |    1 -\n>  4 files changed, 73 insertions(+), 37 deletions(-)\n[...]\n> -\t\t{ \"stat\", cmd_stat, RUN_SETUP | NEED_WORK_TREE },\n>  \t\t{ \"status\", cmd_status, RUN_SETUP | NEED_WORK_TREE },\n\nThis lacks a corresponding update to the Makefile:\n\ndiff --git i/Makefile w/Makefile\nindex f384a52..8a7509c 100644\n--- i/Makefile\n+++ w/Makefile\n@@ -383,7 +383,6 @@ BUILT_INS += git-init$X\n BUILT_INS += git-merge-subtree$X\n BUILT_INS += git-peek-remote$X\n BUILT_INS += git-repo-config$X\n-BUILT_INS += git-stat$X\n BUILT_INS += git-show$X\n BUILT_INS += git-stage$X\n BUILT_INS += git-status$X\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"}]}