Merge branch 'jn/gitweb-docs'
authorJunio C Hamano <gitster@pobox.com>
Mon, 6 Jun 2011 18:40:18 +0000 (11:40 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Jun 2011 18:40:18 +0000 (11:40 -0700)
* jn/gitweb-docs:
gitweb: Move "Requirements" up in gitweb/INSTALL
gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL
gitweb: Move information about installation from README to INSTALL

builtin/commit.c
diff-lib.c
diff.c
diff.h
t/t4040-whitespace-status.sh
t/t7508-status.sh
tree-diff.c
index 5286432f39b87e03a08cc86bb622b6ca3b911365..e1af9b19f0be71484ae9341762dc2bf89cabb70c 100644 (file)
@@ -1207,9 +1207,6 @@ int cmd_status(int argc, const char **argv, const char *prefix)
        if (argc == 2 && !strcmp(argv[1], "-h"))
                usage_with_options(builtin_status_usage, builtin_status_options);
 
-       if (null_termination && status_format == STATUS_FORMAT_LONG)
-               status_format = STATUS_FORMAT_PORCELAIN;
-
        wt_status_prepare(&s);
        gitmodules_config();
        git_config(git_status_config, &s);
@@ -1217,6 +1214,10 @@ int cmd_status(int argc, const char **argv, const char *prefix)
        argc = parse_options(argc, argv, prefix,
                             builtin_status_options,
                             builtin_status_usage, 0);
+
+       if (null_termination && status_format == STATUS_FORMAT_LONG)
+               status_format = STATUS_FORMAT_PORCELAIN;
+
        handle_untracked_files_arg(&s);
        if (show_ignored_in_status)
                s.show_ignored_files = 1;
index 3b5f2242a597ff1b44a3af6be72cb14e6e0d5455..9c29293bbc05d175ba13338813e8532c7ad677cf 100644 (file)
@@ -102,9 +102,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
                int changed;
                unsigned dirty_submodule = 0;
 
-               if (DIFF_OPT_TST(&revs->diffopt, QUICK) &&
-                   !revs->diffopt.filter &&
-                   DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES))
+               if (diff_can_quit_early(&revs->diffopt))
                        break;
 
                if (!ce_path_match(ce, &revs->prune_data))
diff --git a/diff.c b/diff.c
index 8f4815bfd7d798f2a99131cd2e79155e933c7876..61bedaed57216cadaf2716ef7aa0d63889571f8a 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -4456,6 +4456,13 @@ int diff_result_code(struct diff_options *opt, int status)
        return result;
 }
 
+int diff_can_quit_early(struct diff_options *opt)
+{
+       return (DIFF_OPT_TST(opt, QUICK) &&
+               !opt->filter &&
+               DIFF_OPT_TST(opt, HAS_CHANGES));
+}
+
 /*
  * Shall changes to this submodule be ignored?
  *
diff --git a/diff.h b/diff.h
index adb40ba273ffec74010a36e98a538fcc204919f1..6d303c1d50aa799ec90aeb64b2a1b1f55811dd46 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -198,6 +198,8 @@ extern void diff_tree_combined_merge(const unsigned char *sha1, int, struct rev_
 
 void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const char *b);
 
+extern int diff_can_quit_early(struct diff_options *);
+
 extern void diff_addremove(struct diff_options *,
                           int addremove,
                           unsigned mode,
index abc49348b196cf0fec232b6f2399356e4fe324d5..3c728a3ebf9ce52e5c24c81525d5cb749cfb2957 100755 (executable)
@@ -67,4 +67,9 @@ test_expect_success 'diff-files --diff-filter --quiet' '
        test_must_fail git diff-files --diff-filter=M --quiet
 '
 
+test_expect_success 'diff-tree --diff-filter --quiet' '
+       git commit -a -m "worktree state" &&
+       test_must_fail git diff-tree --diff-filter=M --quiet HEAD^ HEAD
+'
+
 test_done
index cd6e2c5e871230a43f504e165498139d8ec7a3d2..1fdfbd38654a83771f677f2219403e3713abef51 100755 (executable)
@@ -780,6 +780,13 @@ test_expect_success 'status -s submodule summary (clean submodule)' '
        test_cmp expect output
 '
 
+test_expect_success 'status -z implies porcelain' '
+       git status --porcelain |
+       perl -pe "s/\012/\000/g" >expect &&
+       git status -z >output &&
+       test_cmp expect output
+'
+
 cat >expect <<EOF
 # On branch master
 # Changes to be committed:
index 3f4072525b9489a86b2231748abe13c611e05274..b3cc2e4753447d4734ed08a70e3396771257dced 100644 (file)
@@ -142,8 +142,7 @@ int diff_tree(struct tree_desc *t1, struct tree_desc *t2,
        strbuf_add(&base, base_str, baselen);
 
        for (;;) {
-               if (DIFF_OPT_TST(opt, QUICK) &&
-                   DIFF_OPT_TST(opt, HAS_CHANGES))
+               if (diff_can_quit_early(opt))
                        break;
                if (opt->pathspec.nr) {
                        skip_uninteresting(t1, &base, opt, &t1_match);