{"thread":{"id":"21551","subject":"[PATCH 3/5] Add the configuration option skipFetchAll","startedAt":"2009-11-09T20:11:06Z","lastAt":"2009-11-09T20:11:06Z","messageCount":1,"participants":["Björn Gustavsson"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"127194","messageId":"4AF8775A.5050301@gmail.com","threadId":"21551","inReplyTo":null,"subject":"[PATCH 3/5] Add the configuration option skipFetchAll","fromName":"Björn Gustavsson","fromEmail":"bgustavsson@gmail.com","sentAt":"2009-11-09T20:11:06Z","receivedAt":"2009-11-09T20:11:06Z","isPatch":true,"sender":{"key":"bgustavsson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/74840?v=4"},"body":"Implement the configuration skipFetchAll option to allow\ncertain remotes to be skipped when doing 'git fetch --all' and\n'git remote update'. The existing skipDefaultUpdate variable\nis still honored (by 'git fetch --all' and 'git remote update').\n(If both are set in the configuration file with different values,\nthe value of the last occurrence will be used.)\n\nSigned-off-by: Björn Gustavsson <bgustavsson@gmail.com>\n---\n Documentation/config.txt  |    8 +++++++-\n builtin-fetch.c           |    3 ++-\n remote.c                  |    3 ++-\n t/t5514-fetch-multiple.sh |   40 +++++++++++++++++++++++++++++++++++++---\n 4 files changed, 48 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex d1e2120..348b367 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1394,7 +1394,13 @@ remote.<name>.mirror::\n \n remote.<name>.skipDefaultUpdate::\n \tIf true, this remote will be skipped by default when updating\n-\tusing the update subcommand of linkgit:git-remote[1].\n+\tusing linkgit:git-fetch[1] or the `update` subcommand of\n+\tlinkgit:git-remote[1].\n+\n+remote.<name>.skipFetchAll::\n+\tIf true, this remote will be skipped by default when updating\n+\tusing linkgit:git-fetch[1] or the `update` subcommand of\n+\tlinkgit:git-remote[1].\n \n remote.<name>.receivepack::\n \tThe default program to execute on the remote side when pushing.  See\ndiff --git a/builtin-fetch.c b/builtin-fetch.c\nindex a5a70a0..945dfd8 100644\n--- a/builtin-fetch.c\n+++ b/builtin-fetch.c\n@@ -690,7 +690,8 @@ static void set_option(const char *name, const char *value)\n static int get_one_remote_for_fetch(struct remote *remote, void *priv)\n {\n \tstruct string_list *list = priv;\n-\tstring_list_append(remote->name, list);\n+\tif (!remote->skip_default_update)\n+\t\tstring_list_append(remote->name, list);\n \treturn 0;\n }\n \ndiff --git a/remote.c b/remote.c\nindex 73d33f2..beaf9fb 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -396,7 +396,8 @@ static int handle_config(const char *key, const char *value, void *cb)\n \t\tremote->mirror = git_config_bool(key, value);\n \telse if (!strcmp(subkey, \".skipdefaultupdate\"))\n \t\tremote->skip_default_update = git_config_bool(key, value);\n-\n+\telse if (!strcmp(subkey, \".skipfetchall\"))\n+\t\tremote->skip_default_update = git_config_bool(key, value);\n \telse if (!strcmp(subkey, \".url\")) {\n \t\tconst char *v;\n \t\tif (git_config_string(&v, key, value))\ndiff --git a/t/t5514-fetch-multiple.sh b/t/t5514-fetch-multiple.sh\nindex 69c64ab..b737332 100755\n--- a/t/t5514-fetch-multiple.sh\n+++ b/t/t5514-fetch-multiple.sh\n@@ -94,9 +94,6 @@ test_expect_success 'git fetch --multiple (but only one remote)' '\n cat > expect << EOF\n   one/master\n   one/side\n-  origin/HEAD -> origin/master\n-  origin/master\n-  origin/side\n   two/another\n   two/master\n   two/side\n@@ -105,6 +102,7 @@ EOF\n test_expect_success 'git fetch --multiple (two remotes)' '\n \t(git clone one test4 &&\n \t cd test4 &&\n+\t git remote rm origin &&\n \t git remote add one ../one &&\n \t git remote add two ../two &&\n \t git fetch --multiple one two &&\n@@ -117,4 +115,40 @@ test_expect_success 'git fetch --multiple (bad remote names)' '\n \t test_must_fail git fetch --multiple four)\n '\n \n+\n+test_expect_success 'git fetch --all (skipFetchAll)' '\n+\t(cd test4 &&\n+\t for b in $(git branch -r)\n+\t do\n+\t\tgit branch -r -d $b || break\n+\t done &&\n+\t git remote add three ../three &&\n+\t git config remote.three.skipFetchAll true &&\n+\t git fetch --all &&\n+\t git branch -r > output &&\n+\t test_cmp ../expect output)\n+'\n+\n+cat > expect << EOF\n+  one/master\n+  one/side\n+  three/another\n+  three/master\n+  three/side\n+  two/another\n+  two/master\n+  two/side\n+EOF\n+\n+test_expect_success 'git fetch --multiple (ignoring skipFetchAll)' '\n+\t(cd test4 &&\n+\t for b in $(git branch -r)\n+\t do\n+\t\tgit branch -r -d $b || break\n+\t done &&\n+\t git fetch --multiple one two three &&\n+\t git branch -r > output &&\n+\t test_cmp ../expect output)\n+'\n+\n test_done\n-- \n1.6.5.1.69.g36942\n"}]}