{"thread":{"id":"34102","subject":"[PATCH v4 1/2] status: introduce status.short to enable --short by default","startedAt":"2013-06-11T13:34:04Z","lastAt":"2013-06-12T06:57:55Z","messageCount":5,"participants":["jorge-juan.garcia-garcia@ensimag.imag.fr","Matthieu Moy","Junio C Hamano"],"isPatch":true,"patchVersion":4,"patchTotal":2},"messages":[{"id":"220433","messageId":"1370957645-17905-1-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr","threadId":"34102","inReplyTo":null,"subject":"[PATCH v4 1/2] status: introduce status.short to enable --short by default","fromName":"","fromEmail":"jorge-juan.garcia-garcia@ensimag.imag.fr","sentAt":"2013-06-11T13:34:04Z","receivedAt":"2013-06-11T13:34:04Z","isPatch":true,"sender":{"key":"jorge-juan.garcia-garcia@ensimag.imag.fr","avatar":null},"body":"From: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>\n\nSome people always run 'git status -s'.\nThe configuration variable status.short allows to set it by default.\n\nSigned-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>\nSigned-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>\nSigned-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\n---\nChanges since v3:\n- Changes the order of the test between expected and actual.\n- Format by default when status.short is not defined adequately.\n- The number of test is the same (all posibilities that I wanted tested).\n---\n Documentation/config.txt |    4 ++++\n builtin/commit.c         |    7 +++++++\n t/t7508-status.sh        |   35 +++++++++++++++++++++++++++++++++++\n 3 files changed, 46 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 6e53fc5..1983bf7 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -2066,6 +2066,10 @@ status.relativePaths::\n \trelative to the repository root (this was the default for Git\n \tprior to v1.5.4).\n \n+status.short::\n+\tSet to true to enable --short by default in linkgit:git-status[1].\n+\tThe option --no-short takes precedence over this variable.\n+\n status.showUntrackedFiles::\n \tBy default, linkgit:git-status[1] and linkgit:git-commit[1] show\n \tfiles which are not currently tracked by Git. Directories which\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 1621dfc..075a91c 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1112,6 +1112,13 @@ static int git_status_config(const char *k, const char *v, void *cb)\n \t\t\ts->submodule_summary = -1;\n \t\treturn 0;\n \t}\n+\tif (!strcmp(k, \"status.short\")) {\n+\t\tif (git_config_bool(k, v))\n+\t\t\tstatus_format = STATUS_FORMAT_SHORT;\n+\t\telse\n+\t\t\tstatus_format = STATUS_FORMAT_NONE;\n+\t\treturn 0;\n+\t}\n \tif (!strcmp(k, \"status.color\") || !strcmp(k, \"color.status\")) {\n \t\ts->use_color = git_config_colorbool(k, v);\n \t\treturn 0;\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex e2ffdac..3c0818b 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1335,4 +1335,39 @@ test_expect_failure '.git/config ignore=all suppresses submodule summary' '\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n+test_expect_success 'Setup of test environment' '\n+\tgit config status.showUntrackedFiles no\n+'\n+\n+test_expect_success '\"status.short=true\" same as \"-s\"' '\n+\tgit -c status.short=true status >actual &&\n+\tgit status -s >expected_short &&\n+\ttest_cmp expected_short actual\n+'\n+\n+test_expect_success '\"status.short=true\" different from \"--no-short\"' '\n+\tgit status --no-short >expected_noshort &&\n+\ttest_must_fail test_cmp expected_noshort actual\n+'\n+\n+test_expect_success '\"status.short=true\" weaker than \"--no-short\"' '\n+\tgit -c status.short=true status --no-short >actual &&\n+\ttest_cmp expected_noshort actual\n+'\n+\n+test_expect_success '\"status.short=false\" same as \"--no-short\"' '\n+\tgit -c status.short=false status >actual &&\n+\tgit status -s >expected_short &&\n+\ttest_cmp expected_noshort actual\n+'\n+\n+test_expect_success '\"status.short=false\" weaker than \"-s\"' '\n+\tgit -c status.short=false status -s >actual &&\n+\ttest_cmp expected_short actual\n+'\n+\n+test_expect_success 'Restore default test environment' '\n+\tgit config --unset status.showUntrackedFiles\n+'\n+\n test_done\n-- \n1.7.8\n"},{"id":"220436","messageId":"1370957645-17905-2-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr","threadId":"34102","inReplyTo":"1370957645-17905-1-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr","subject":"[PATCH v4 2/2] status:introduce status.branch to enable --branch by default","fromName":"","fromEmail":"jorge-juan.garcia-garcia@ensimag.imag.fr","sentAt":"2013-06-11T13:34:05Z","receivedAt":"2013-06-11T13:34:05Z","isPatch":true,"sender":{"key":"jorge-juan.garcia-garcia@ensimag.imag.fr","avatar":null},"body":"From: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>\n\nSome people often run 'git status -b'.\nThe config variable status.branch allows to set it by default.\n\nSigned-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>\nSigned-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>\nSigned-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\n---\nChanges since v3:\n- Changes in the order in test between expected and actual.\n- The number of test is the same (all posibilities that I wanted tested).\n---\n Documentation/config.txt |    4 ++++\n builtin/commit.c         |    4 ++++\n t/t7508-status.sh        |   27 +++++++++++++++++++++++++++\n 3 files changed, 35 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 1983bf7..ecdcd6d 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -2070,6 +2070,10 @@ status.short::\n \tSet to true to enable --short by default in linkgit:git-status[1].\n \tThe option --no-short takes precedence over this variable.\n \n+status.branch::\n+\tSet to true to enable --branch by default in linkgit:git-status[1].\n+\tThe option --no-branch takes precedence over this variable.\n+\n status.showUntrackedFiles::\n \tBy default, linkgit:git-status[1] and linkgit:git-commit[1] show\n \tfiles which are not currently tracked by Git. Directories which\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 075a91c..b589ce0 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1119,6 +1119,10 @@ static int git_status_config(const char *k, const char *v, void *cb)\n \t\t\tstatus_format = STATUS_FORMAT_NONE;\n \t\treturn 0;\n \t}\n+\tif (!strcmp(k, \"status.branch\")) {\n+\t\ts->show_branch = git_config_bool(k, v);\n+\t\treturn 0;\n+\t}\n \tif (!strcmp(k, \"status.color\") || !strcmp(k, \"color.status\")) {\n \t\ts->use_color = git_config_colorbool(k, v);\n \t\treturn 0;\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 3c0818b..d627f9b 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1366,6 +1366,33 @@ test_expect_success '\"status.short=false\" weaker than \"-s\"' '\n \ttest_cmp expected_short actual\n '\n \n+test_expect_success '\"status.branch=true\" same as \"-b\"' '\n+\tgit -c status.branch=true status -s >actual &&\n+\tgit status -sb >expected_branch &&\n+\ttest_cmp expected_branch actual\n+'\n+\n+test_expect_success '\"status.branch=true\" different from \"--no-branch\"' '\n+\tgit -c status.branch=true status -s >actual &&\n+\tgit status -s --no-branch  >expected_nobranch &&\n+\ttest_must_fail test_cmp expected_nobranch actual\n+'\n+\n+test_expect_success '\"status.branch=true\" weaker than \"--no-branch\"' '\n+\tgit -c status.branch=true status -s --no-branch >actual &&\n+\ttest_cmp expected_nobranch actual\n+'\n+\n+test_expect_success '\"status.branch=false\" same as \"--no-branch\"' '\n+\tgit -c status.branch=false status -s >actual &&\n+\ttest_cmp expected_nobranch actual\n+'\n+\n+test_expect_success '\"status.branch=false\" weaker than \"-b\"' '\n+\tgit -c status.branch=false status -sb >actual &&\n+\ttest_cmp expected_branch actual\n+'\n+\n test_expect_success 'Restore default test environment' '\n \tgit config --unset status.showUntrackedFiles\n '\n-- \n1.7.8\n"},{"id":"220437","messageId":"vpqwqq03gr0.fsf@anie.imag.fr","threadId":"34102","inReplyTo":"1370957645-17905-2-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr","subject":"Re: [PATCH v4 2/2] status:introduce status.branch to enable --branch by default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-06-11T13:43:15Z","receivedAt":"2013-06-11T13:43:15Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jorge-Juan.Garcia-Garcia@ensimag.imag.fr writes:\n\n> +test_expect_success '\"status.branch=true\" different from \"--no-branch\"' '\n> +\tgit -c status.branch=true status -s >actual &&\n> +\tgit status -s --no-branch  >expected_nobranch &&\n\nTwo nitpicks:\n\nThere are two spaces before >, there should be one.\n\nIf the first \"git\" command fails, then you fail to create\nexpected_nobranch and the other tests fail too. Creating\nexpected_nobranch before actual would solve this. You have the same\nissue in PATCH 1/2.\n\nWith or without these fixed,\n\nReviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\n\n(both patches)\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"220514","messageId":"7v1u889vkj.fsf@alter.siamese.dyndns.org","threadId":"34102","inReplyTo":"1370957645-17905-1-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr","subject":"Re: [PATCH v4 1/2] status: introduce status.short to enable --short by default","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-11T21:38:52Z","receivedAt":"2013-06-11T21:38:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jorge-Juan.Garcia-Garcia@ensimag.imag.fr writes:\n\n> diff --git a/t/t7508-status.sh b/t/t7508-status.sh\n> index e2ffdac..3c0818b 100755\n> --- a/t/t7508-status.sh\n> +++ b/t/t7508-status.sh\n> @@ -1335,4 +1335,39 @@ test_expect_failure '.git/config ignore=all suppresses submodule summary' '\n>  \tgit config -f .gitmodules  --remove-section submodule.subname\n>  '\n>  \n> +test_expect_success 'Setup of test environment' '\n> +\tgit config status.showUntrackedFiles no\n> +'\n> +\n> +test_expect_success '\"status.short=true\" same as \"-s\"' '\n> +\tgit -c status.short=true status >actual &&\n> +\tgit status -s >expected_short &&\n> +\ttest_cmp expected_short actual\n> +'\n> +\n> +test_expect_success '\"status.short=true\" different from \"--no-short\"' '\n> +\tgit status --no-short >expected_noshort &&\n> +\ttest_must_fail test_cmp expected_noshort actual\n> +'\n\nI am not sure if \"must be different, and I do not care what kind of\ndifference we get\" is a good test.\n\n> +test_expect_success '\"status.short=true\" weaker than \"--no-short\"' '\n> +\tgit -c status.short=true status --no-short >actual &&\n> +\ttest_cmp expected_noshort actual\n> +'\n> +\n> +test_expect_success '\"status.short=false\" same as \"--no-short\"' '\n> +\tgit -c status.short=false status >actual &&\n> +\tgit status -s >expected_short &&\n> +\ttest_cmp expected_noshort actual\n> +'\n\nI think the second line in this test is unwanted.\n\n> +\n> +test_expect_success '\"status.short=false\" weaker than \"-s\"' '\n> +\tgit -c status.short=false status -s >actual &&\n> +\ttest_cmp expected_short actual\n> +'\n> +\n> +test_expect_success 'Restore default test environment' '\n> +\tgit config --unset status.showUntrackedFiles\n> +'\n> +\n>  test_done\n\nI'll queue this patch after tweaking the test part like this.\n\nThanks.\n\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex e2ffdac..33cadd0 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1335,4 +1335,34 @@ test_expect_failure '.git/config ignore=all suppresses submodule summary' '\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n+test_expect_success 'setup of test environment' '\n+\tgit config status.showUntrackedFiles no &&\n+\tgit status -s >expected_short &&\n+\tgit status --no-short >expected_noshort\n+'\n+\n+test_expect_success '\"status.short=true\" same as \"-s\"' '\n+\tgit -c status.short=true status >actual &&\n+\ttest_cmp expected_short actual\n+'\n+\n+test_expect_success '\"status.short=true\" weaker than \"--no-short\"' '\n+\tgit -c status.short=true status --no-short >actual &&\n+\ttest_cmp expected_noshort actual\n+'\n+\n+test_expect_success '\"status.short=false\" same as \"--no-short\"' '\n+\tgit -c status.short=false status >actual &&\n+\ttest_cmp expected_noshort actual\n+'\n+\n+test_expect_success '\"status.short=false\" weaker than \"-s\"' '\n+\tgit -c status.short=false status -s >actual &&\n+\ttest_cmp expected_short actual\n+'\n+\n+test_expect_success 'Restore default test environment' '\n+\tgit config --unset status.showUntrackedFiles\n+'\n+\n test_done\n"},{"id":"220584","messageId":"vpqfvwn24uk.fsf@anie.imag.fr","threadId":"34102","inReplyTo":"7v1u889vkj.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4 1/2] status: introduce status.short to enable --short by default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-06-12T06:57:55Z","receivedAt":"2013-06-12T06:57:55Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I'll queue this patch after tweaking the test part like this.\n\nI agree your version is better, thanks.\n\nJorge: this means if you have to edit the patch further, you'll have to\nstart with the version in Junio's pu. But hopefully you won't have to.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}