{"thread":{"id":"34091","subject":"[PATCH v2 2/2] status:introduce status.branch to enable --branch by default","startedAt":"2013-06-10T14:40:25Z","lastAt":"2013-06-10T14:43:36Z","messageCount":3,"participants":["Jorge Juan Garcia Garcia","Matthieu Moy"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"220293","messageId":"1370875226-31392-1-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr","threadId":"34091","inReplyTo":null,"subject":"[PATCH v2 1/2] status: introduce status.short to enable --short by default","fromName":"Jorge Juan Garcia Garcia","fromEmail":"jorge-juan.garcia-garcia@ensimag.imag.fr","sentAt":"2013-06-10T14:40:25Z","receivedAt":"2013-06-10T14:40:25Z","isPatch":true,"sender":{"key":"jorge-juan.garcia-garcia@ensimag.imag.fr","avatar":null},"body":"Some 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---\n\nChanges since v1:\n -documentation more accurate\n -removal of unappropriate function calls\n -clean-up in the test\n\n Documentation/config.txt |    4 ++++\n builtin/commit.c         |    5 +++++\n t/t7508-status.sh        |   35 +++++++++++++++++++++++++++++++++++\n 3 files changed, 44 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..287f1cb 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1112,6 +1112,11 @@ 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\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..9a07f15 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 environment of test\"' '\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 actual expected_short\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 actual expected_noshort\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 actual expected_noshort\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 actual expected_noshort\n+'\n+\n+test_expect_success '\"status.short=false\" weaker than \"-s\"' '\n+\tgit -c status.short=false status -s >actual &&\n+\ttest_cmp actual expected_short\n+'\n+\n+test_expect_success '\"Back to environment of test by default\"' '\n+\tgit config status.showUntrackedFiles yes\n+'\n+\n test_done\n-- \n1.7.8\n"},{"id":"220292","messageId":"1370875226-31392-2-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr","threadId":"34091","inReplyTo":"1370875226-31392-1-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr","subject":"[PATCH v2 2/2] status:introduce status.branch to enable --branch by default","fromName":"Jorge Juan Garcia Garcia","fromEmail":"jorge-juan.garcia-garcia@ensimag.imag.fr","sentAt":"2013-06-10T14:40:26Z","receivedAt":"2013-06-10T14:40:26Z","isPatch":true,"sender":{"key":"jorge-juan.garcia-garcia@ensimag.imag.fr","avatar":null},"body":"Some 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---\n\nChanges since v1:\n -Documentation more accurate\n -removal of unappropriate function calls\n -clean up in the test\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 287f1cb..f2b5d44 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1117,6 +1117,10 @@ static int git_status_config(const char *k, const char *v, void *cb)\n \t\t\tstatus_format = STATUS_FORMAT_SHORT;\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 9a07f15..958617a 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 actual expected_short\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 actual expected_branch\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 actual expected_nobranch\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 actual expected_nobranch\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 actual expected_nobranch\n+'\n+\n+test_expect_success '\"status.branch=false\" weaker than \"-b\"' '\n+\tgit -c status.branch=false status -sb >actual &&\n+\ttest_cmp actual expected_branch\n+'\n+\n test_expect_success '\"Back to environment of test by default\"' '\n \tgit config status.showUntrackedFiles yes\n '\n-- \n1.7.8\n"},{"id":"220295","messageId":"vpqli6igh5z.fsf@anie.imag.fr","threadId":"34091","inReplyTo":"1370875226-31392-1-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr","subject":"Re: [PATCH v2 1/2] status: introduce status.short to enable --short by default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-06-10T14:43:36Z","receivedAt":"2013-06-10T14:43:36Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>\nwrites:\n\n> +test_expect_success '\"Setup of environment of test\"' '\n\nWhy these double quotes inside single quotes?\n\n> +test_expect_success '\"Back to environment of test by default\"' '\n\nSame.\n\n\"test environment\" would sound better than \"environment of test\" in\nenglish.\n\n> +\tgit config status.showUntrackedFiles yes\n\n\"yes\" is not documented as an acceptable value for\nstatus.showUntrackedFiles.\n\n\"git config --unset\" is what you want here.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}