{"thread":{"id":"16205","subject":"[PATCH] Teach/Fix pull/fetch -q/-v options","startedAt":"2008-11-07T03:26:27Z","lastAt":"2008-11-15T00:09:01Z","messageCount":4,"participants":["Tuncer Ayaz","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"95096","messageId":"1226028387-23867-1-git-send-email-tuncer.ayaz@gmail.com","threadId":"16205","inReplyTo":null,"subject":"[PATCH] Teach/Fix pull/fetch -q/-v options","fromName":"Tuncer Ayaz","fromEmail":"tuncer.ayaz@gmail.com","sentAt":"2008-11-07T03:26:27Z","receivedAt":"2008-11-07T03:26:27Z","isPatch":true,"sender":{"key":"tuncer.ayaz@gmail.com","avatar":null},"body":"Implement git-pull --quiet and git-pull --verbose by\nadding the options to git-pull and fixing verbosity\nhandling in git-fetch.\n\nSigned-off-by: Tuncer Ayaz <tuncer.ayaz@gmail.com>\n---\n Documentation/merge-options.txt |    8 +++++\n builtin-fetch.c                 |   21 +++++++------\n builtin-merge.c                 |   22 ++++++++++----\n git-pull.sh                     |   10 ++++--\n t/t5521-pull-options.sh         |   60 +++++++++++++++++++++++++++++++++++++++\n 5 files changed, 101 insertions(+), 20 deletions(-)\n create mode 100755 t/t5521-pull-options.sh\n\ndiff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\nindex 007909a..427cdef 100644\n--- a/Documentation/merge-options.txt\n+++ b/Documentation/merge-options.txt\n@@ -1,3 +1,11 @@\n+-q::\n+--quiet::\n+\tOperate quietly.\n+\n+-v::\n+--verbose::\n+\tBe verbose.\n+\n --stat::\n \tShow a diffstat at the end of the merge. The diffstat is also\n \tcontrolled by the configuration option merge.stat.\ndiff --git a/builtin-fetch.c b/builtin-fetch.c\nindex f151cfa..efc5801 100644\n--- a/builtin-fetch.c\n+++ b/builtin-fetch.c\n@@ -22,16 +22,17 @@ enum {\n \tTAGS_SET = 2\n };\n \n-static int append, force, keep, update_head_ok, verbose, quiet;\n+static int append, force, keep, update_head_ok;\n static int tags = TAGS_DEFAULT;\n static const char *depth;\n static const char *upload_pack;\n static struct strbuf default_rla = STRBUF_INIT;\n static struct transport *transport;\n+static enum { QUIET, NORMAL, VERBOSE } verbosity = NORMAL;\n \n static struct option builtin_fetch_options[] = {\n-\tOPT__QUIET(&quiet),\n-\tOPT__VERBOSE(&verbose),\n+\tOPT_SET_INT('v', \"verbose\", &verbosity, \"be verbose\", VERBOSE),\n+\tOPT_SET_INT('q', \"quiet\", &verbosity, \"operate quietly\", QUIET),\n \tOPT_BOOLEAN('a', \"append\", &append,\n \t\t    \"append to .git/FETCH_HEAD instead of overwriting\"),\n \tOPT_STRING(0, \"upload-pack\", &upload_pack, \"PATH\",\n@@ -192,7 +193,6 @@ static int s_update_ref(const char *action,\n \n static int update_local_ref(struct ref *ref,\n \t\t\t    const char *remote,\n-\t\t\t    int verbose,\n \t\t\t    char *display)\n {\n \tstruct commit *current = NULL, *updated;\n@@ -210,7 +210,7 @@ static int update_local_ref(struct ref *ref,\n \t\tdie(\"object %s not found\", sha1_to_hex(ref->new_sha1));\n \n \tif (!hashcmp(ref->old_sha1, ref->new_sha1)) {\n-\t\tif (verbose)\n+\t\tif (verbosity == VERBOSE)\n \t\t\tsprintf(display, \"= %-*s %-*s -> %s\", SUMMARY_WIDTH,\n \t\t\t\t\"[up to date]\", REFCOL_WIDTH, remote,\n \t\t\t\tpretty_ref);\n@@ -366,18 +366,19 @@ static int store_updated_refs(const char *url, const char *remote_name,\n \t\t\tnote);\n \n \t\tif (ref)\n-\t\t\trc |= update_local_ref(ref, what, verbose, note);\n+\t\t\trc |= update_local_ref(ref, what, note);\n \t\telse\n \t\t\tsprintf(note, \"* %-*s %-*s -> FETCH_HEAD\",\n \t\t\t\tSUMMARY_WIDTH, *kind ? kind : \"branch\",\n \t\t\t\t REFCOL_WIDTH, *what ? what : \"HEAD\");\n \t\tif (*note) {\n-\t\t\tif (!shown_url) {\n+\t\t\tif (verbosity > QUIET && !shown_url) {\n \t\t\t\tfprintf(stderr, \"From %.*s\\n\",\n \t\t\t\t\t\turl_len, url);\n \t\t\t\tshown_url = 1;\n \t\t\t}\n-\t\t\tfprintf(stderr, \" %s\\n\", note);\n+\t\t\tif (verbosity > QUIET)\n+\t\t\t\tfprintf(stderr, \" %s\\n\", note);\n \t\t}\n \t}\n \tfclose(fp);\n@@ -637,9 +638,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \t\tremote = remote_get(argv[0]);\n \n \ttransport = transport_get(remote, remote->url[0]);\n-\tif (verbose >= 2)\n+\tif (verbosity == VERBOSE)\n \t\ttransport->verbose = 1;\n-\tif (quiet)\n+\tif (verbosity == QUIET)\n \t\ttransport->verbose = -1;\n \tif (upload_pack)\n \t\tset_option(TRANS_OPT_UPLOADPACK, upload_pack);\ndiff --git a/builtin-merge.c b/builtin-merge.c\nindex 5e7910b..76e2890 100644\n--- a/builtin-merge.c\n+++ b/builtin-merge.c\n@@ -50,6 +50,7 @@ static unsigned char head[20], stash[20];\n static struct strategy **use_strategies;\n static size_t use_strategies_nr, use_strategies_alloc;\n static const char *branch;\n+static enum { QUIET, NORMAL, VERBOSE } verbosity = NORMAL;\n \n static struct strategy all_strategy[] = {\n \t{ \"recursive\",  DEFAULT_TWOHEAD | NO_TRIVIAL },\n@@ -152,6 +153,8 @@ static int option_parse_n(const struct option *opt,\n }\n \n static struct option builtin_merge_options[] = {\n+\tOPT_SET_INT('v', \"verbose\", &verbosity, \"be verbose\", VERBOSE),\n+\tOPT_SET_INT('q', \"quiet\", &verbosity, \"operate quietly\", QUIET),\n \t{ OPTION_CALLBACK, 'n', NULL, NULL, NULL,\n \t\t\"do not show a diffstat at the end of the merge\",\n \t\tPARSE_OPT_NOARG, option_parse_n },\n@@ -250,7 +253,8 @@ static void restore_state(void)\n /* This is called when no merge was necessary. */\n static void finish_up_to_date(const char *msg)\n {\n-\tprintf(\"%s%s\\n\", squash ? \" (nothing to squash)\" : \"\", msg);\n+\tif (verbosity > QUIET)\n+\t\tprintf(\"%s%s\\n\", squash ? \" (nothing to squash)\" : \"\", msg);\n \tdrop_save();\n }\n \n@@ -331,14 +335,15 @@ static void finish(const unsigned char *new_head, const char *msg)\n \tif (!msg)\n \t\tstrbuf_addstr(&reflog_message, getenv(\"GIT_REFLOG_ACTION\"));\n \telse {\n-\t\tprintf(\"%s\\n\", msg);\n+\t\tif (verbosity > QUIET)\n+\t\t\tprintf(\"%s\\n\", msg);\n \t\tstrbuf_addf(&reflog_message, \"%s: %s\",\n \t\t\tgetenv(\"GIT_REFLOG_ACTION\"), msg);\n \t}\n \tif (squash) {\n \t\tsquash_message();\n \t} else {\n-\t\tif (!merge_msg.len)\n+\t\tif (verbosity > QUIET && !merge_msg.len)\n \t\t\tprintf(\"No merge message -- not updating HEAD\\n\");\n \t\telse {\n \t\t\tconst char *argv_gc_auto[] = { \"gc\", \"--auto\", NULL };\n@@ -872,6 +877,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \n \targc = parse_options(argc, argv, builtin_merge_options,\n \t\t\tbuiltin_merge_usage, 0);\n+\tif (verbosity > QUIET)\n+\t\tshow_diffstat = 0;\n \n \tif (squash) {\n \t\tif (!allow_fast_forward)\n@@ -1013,10 +1020,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \n \t\tstrcpy(hex, find_unique_abbrev(head, DEFAULT_ABBREV));\n \n-\t\tprintf(\"Updating %s..%s\\n\",\n-\t\t\thex,\n-\t\t\tfind_unique_abbrev(remoteheads->item->object.sha1,\n-\t\t\tDEFAULT_ABBREV));\n+\t\tif (verbosity > QUIET)\n+\t\t\tprintf(\"Updating %s..%s\\n\",\n+\t\t\t\thex,\n+\t\t\t\tfind_unique_abbrev(remoteheads->item->object.sha1,\n+\t\t\t\tDEFAULT_ABBREV));\n \t\tstrbuf_addstr(&msg, \"Fast forward\");\n \t\tif (have_message)\n \t\t\tstrbuf_addstr(&msg,\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 664fe34..8866f2a 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -16,13 +16,17 @@ cd_to_toplevel\n test -z \"$(git ls-files -u)\" ||\n \tdie \"You are in the middle of a conflicted merge.\"\n \n-strategy_args= no_stat= no_commit= squash= no_ff= log_arg=\n+strategy_args= no_stat= no_commit= squash= no_ff= log_arg= verbosity=\n curr_branch=$(git symbolic-ref -q HEAD)\n curr_branch_short=$(echo \"$curr_branch\" | sed \"s|refs/heads/||\")\n rebase=$(git config --bool branch.$curr_branch_short.rebase)\n while :\n do\n \tcase \"$1\" in\n+\t-q|--quiet)\n+\t\tverbosity=-q ;;\n+\t-v|--verbose)\n+\t\tverbosity=-v ;;\n \t-n|--no-stat|--no-summary)\n \t\tno_stat=-n ;;\n \t--stat|--summary)\n@@ -121,7 +125,7 @@ test true = \"$rebase\" && {\n \t\t\"refs/remotes/$origin/$reflist\" 2>/dev/null)\"\n }\n orig_head=$(git rev-parse --verify HEAD 2>/dev/null)\n-git fetch --update-head-ok \"$@\" || exit 1\n+git fetch $verbosity --update-head-ok \"$@\" || exit 1\n \n curr_head=$(git rev-parse --verify HEAD 2>/dev/null)\n if test -n \"$orig_head\" && test \"$curr_head\" != \"$orig_head\"\n@@ -182,4 +186,4 @@ test true = \"$rebase\" &&\n \texec git-rebase $strategy_args --onto $merge_head \\\n \t${oldremoteref:-$merge_head}\n exec git-merge $no_stat $no_commit $squash $no_ff $log_arg $strategy_args \\\n-\t\"$merge_name\" HEAD $merge_head\n+\t\"$merge_name\" HEAD $merge_head $verbosity\ndiff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh\nnew file mode 100755\nindex 0000000..83e2e8a\n--- /dev/null\n+++ b/t/t5521-pull-options.sh\n@@ -0,0 +1,60 @@\n+#!/bin/sh\n+\n+test_description='pull options'\n+\n+. ./test-lib.sh\n+\n+D=`pwd`\n+\n+test_expect_success 'setup' '\n+\tmkdir parent &&\n+\t(cd parent && git init &&\n+\t echo one >file && git add file &&\n+\t git commit -m one)\n+'\n+\n+cd \"$D\"\n+\n+test_expect_success 'git pull -q' '\n+\tmkdir clonedq &&\n+\tcd clonedq &&\n+\tgit pull -q \"$D/parent\" >out 2>err &&\n+\ttest ! -s out\n+'\n+\n+cd \"$D\"\n+\n+test_expect_success 'git pull' '\n+\tmkdir cloned &&\n+\tcd cloned &&\n+\tgit pull \"$D/parent\" >out 2>err &&\n+\ttest -s out\n+'\n+cd \"$D\"\n+\n+test_expect_success 'git pull -v' '\n+\tmkdir clonedv &&\n+\tcd clonedv &&\n+\tgit pull -v \"$D/parent\" >out 2>err &&\n+\ttest -s out\n+'\n+\n+cd \"$D\"\n+\n+test_expect_success 'git pull -v -q' '\n+\tmkdir clonedvq &&\n+\tcd clonedvq &&\n+\tgit pull -v -q \"$D/parent\" >out 2>err &&\n+\ttest ! -s out\n+'\n+\n+cd \"$D\"\n+\n+test_expect_success 'git pull -q -v' '\n+\tmkdir clonedqv &&\n+\tcd clonedqv &&\n+\tgit pull -q -v \"$D/parent\" >out 2>err &&\n+\ttest -s out\n+'\n+\n+test_done\n-- \n1.6.0.2.GIT\n"},{"id":"95407","messageId":"4ac8254d0811101543q612917b5ib83e7e657d17ef3c@mail.gmail.com","threadId":"16205","inReplyTo":"1226028387-23867-1-git-send-email-tuncer.ayaz@gmail.com","subject":"Re: [PATCH] Teach/Fix pull/fetch -q/-v options","fromName":"Tuncer Ayaz","fromEmail":"tuncer.ayaz@gmail.com","sentAt":"2008-11-10T23:43:23Z","receivedAt":"2008-11-10T23:43:23Z","isPatch":true,"sender":{"key":"tuncer.ayaz@gmail.com","avatar":null},"body":"On Fri, Nov 7, 2008 at 4:26 AM, Tuncer Ayaz <tuncer.ayaz@gmail.com> wrote:\n> Implement git-pull --quiet and git-pull --verbose by\n> adding the options to git-pull and fixing verbosity\n> handling in git-fetch.\n\nJunio,\n\nis there anything still missing in this patch?\nMaybe the name of the test-case is bad.\nMaybe you've queued it for review already.\n\nRegards,\n\n        Tuncer Ayaz\n\n> Signed-off-by: Tuncer Ayaz <tuncer.ayaz@gmail.com>\n> ---\n>  Documentation/merge-options.txt |    8 +++++\n>  builtin-fetch.c                 |   21 +++++++------\n>  builtin-merge.c                 |   22 ++++++++++----\n>  git-pull.sh                     |   10 ++++--\n>  t/t5521-pull-options.sh         |   60 +++++++++++++++++++++++++++++++++++++++\n>  5 files changed, 101 insertions(+), 20 deletions(-)\n>  create mode 100755 t/t5521-pull-options.sh\n>\n> diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\n> index 007909a..427cdef 100644\n> --- a/Documentation/merge-options.txt\n> +++ b/Documentation/merge-options.txt\n> @@ -1,3 +1,11 @@\n> +-q::\n> +--quiet::\n> +       Operate quietly.\n> +\n> +-v::\n> +--verbose::\n> +       Be verbose.\n> +\n>  --stat::\n>        Show a diffstat at the end of the merge. The diffstat is also\n>        controlled by the configuration option merge.stat.\n> diff --git a/builtin-fetch.c b/builtin-fetch.c\n> index f151cfa..efc5801 100644\n> --- a/builtin-fetch.c\n> +++ b/builtin-fetch.c\n> @@ -22,16 +22,17 @@ enum {\n>        TAGS_SET = 2\n>  };\n>\n> -static int append, force, keep, update_head_ok, verbose, quiet;\n> +static int append, force, keep, update_head_ok;\n>  static int tags = TAGS_DEFAULT;\n>  static const char *depth;\n>  static const char *upload_pack;\n>  static struct strbuf default_rla = STRBUF_INIT;\n>  static struct transport *transport;\n> +static enum { QUIET, NORMAL, VERBOSE } verbosity = NORMAL;\n>\n>  static struct option builtin_fetch_options[] = {\n> -       OPT__QUIET(&quiet),\n> -       OPT__VERBOSE(&verbose),\n> +       OPT_SET_INT('v', \"verbose\", &verbosity, \"be verbose\", VERBOSE),\n> +       OPT_SET_INT('q', \"quiet\", &verbosity, \"operate quietly\", QUIET),\n>        OPT_BOOLEAN('a', \"append\", &append,\n>                    \"append to .git/FETCH_HEAD instead of overwriting\"),\n>        OPT_STRING(0, \"upload-pack\", &upload_pack, \"PATH\",\n> @@ -192,7 +193,6 @@ static int s_update_ref(const char *action,\n>\n>  static int update_local_ref(struct ref *ref,\n>                            const char *remote,\n> -                           int verbose,\n>                            char *display)\n>  {\n>        struct commit *current = NULL, *updated;\n> @@ -210,7 +210,7 @@ static int update_local_ref(struct ref *ref,\n>                die(\"object %s not found\", sha1_to_hex(ref->new_sha1));\n>\n>        if (!hashcmp(ref->old_sha1, ref->new_sha1)) {\n> -               if (verbose)\n> +               if (verbosity == VERBOSE)\n>                        sprintf(display, \"= %-*s %-*s -> %s\", SUMMARY_WIDTH,\n>                                \"[up to date]\", REFCOL_WIDTH, remote,\n>                                pretty_ref);\n> @@ -366,18 +366,19 @@ static int store_updated_refs(const char *url, const char *remote_name,\n>                        note);\n>\n>                if (ref)\n> -                       rc |= update_local_ref(ref, what, verbose, note);\n> +                       rc |= update_local_ref(ref, what, note);\n>                else\n>                        sprintf(note, \"* %-*s %-*s -> FETCH_HEAD\",\n>                                SUMMARY_WIDTH, *kind ? kind : \"branch\",\n>                                 REFCOL_WIDTH, *what ? what : \"HEAD\");\n>                if (*note) {\n> -                       if (!shown_url) {\n> +                       if (verbosity > QUIET && !shown_url) {\n>                                fprintf(stderr, \"From %.*s\\n\",\n>                                                url_len, url);\n>                                shown_url = 1;\n>                        }\n> -                       fprintf(stderr, \" %s\\n\", note);\n> +                       if (verbosity > QUIET)\n> +                               fprintf(stderr, \" %s\\n\", note);\n>                }\n>        }\n>        fclose(fp);\n> @@ -637,9 +638,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n>                remote = remote_get(argv[0]);\n>\n>        transport = transport_get(remote, remote->url[0]);\n> -       if (verbose >= 2)\n> +       if (verbosity == VERBOSE)\n>                transport->verbose = 1;\n> -       if (quiet)\n> +       if (verbosity == QUIET)\n>                transport->verbose = -1;\n>        if (upload_pack)\n>                set_option(TRANS_OPT_UPLOADPACK, upload_pack);\n> diff --git a/builtin-merge.c b/builtin-merge.c\n> index 5e7910b..76e2890 100644\n> --- a/builtin-merge.c\n> +++ b/builtin-merge.c\n> @@ -50,6 +50,7 @@ static unsigned char head[20], stash[20];\n>  static struct strategy **use_strategies;\n>  static size_t use_strategies_nr, use_strategies_alloc;\n>  static const char *branch;\n> +static enum { QUIET, NORMAL, VERBOSE } verbosity = NORMAL;\n>\n>  static struct strategy all_strategy[] = {\n>        { \"recursive\",  DEFAULT_TWOHEAD | NO_TRIVIAL },\n> @@ -152,6 +153,8 @@ static int option_parse_n(const struct option *opt,\n>  }\n>\n>  static struct option builtin_merge_options[] = {\n> +       OPT_SET_INT('v', \"verbose\", &verbosity, \"be verbose\", VERBOSE),\n> +       OPT_SET_INT('q', \"quiet\", &verbosity, \"operate quietly\", QUIET),\n>        { OPTION_CALLBACK, 'n', NULL, NULL, NULL,\n>                \"do not show a diffstat at the end of the merge\",\n>                PARSE_OPT_NOARG, option_parse_n },\n> @@ -250,7 +253,8 @@ static void restore_state(void)\n>  /* This is called when no merge was necessary. */\n>  static void finish_up_to_date(const char *msg)\n>  {\n> -       printf(\"%s%s\\n\", squash ? \" (nothing to squash)\" : \"\", msg);\n> +       if (verbosity > QUIET)\n> +               printf(\"%s%s\\n\", squash ? \" (nothing to squash)\" : \"\", msg);\n>        drop_save();\n>  }\n>\n> @@ -331,14 +335,15 @@ static void finish(const unsigned char *new_head, const char *msg)\n>        if (!msg)\n>                strbuf_addstr(&reflog_message, getenv(\"GIT_REFLOG_ACTION\"));\n>        else {\n> -               printf(\"%s\\n\", msg);\n> +               if (verbosity > QUIET)\n> +                       printf(\"%s\\n\", msg);\n>                strbuf_addf(&reflog_message, \"%s: %s\",\n>                        getenv(\"GIT_REFLOG_ACTION\"), msg);\n>        }\n>        if (squash) {\n>                squash_message();\n>        } else {\n> -               if (!merge_msg.len)\n> +               if (verbosity > QUIET && !merge_msg.len)\n>                        printf(\"No merge message -- not updating HEAD\\n\");\n>                else {\n>                        const char *argv_gc_auto[] = { \"gc\", \"--auto\", NULL };\n> @@ -872,6 +877,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n>\n>        argc = parse_options(argc, argv, builtin_merge_options,\n>                        builtin_merge_usage, 0);\n> +       if (verbosity > QUIET)\n> +               show_diffstat = 0;\n>\n>        if (squash) {\n>                if (!allow_fast_forward)\n> @@ -1013,10 +1020,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n>\n>                strcpy(hex, find_unique_abbrev(head, DEFAULT_ABBREV));\n>\n> -               printf(\"Updating %s..%s\\n\",\n> -                       hex,\n> -                       find_unique_abbrev(remoteheads->item->object.sha1,\n> -                       DEFAULT_ABBREV));\n> +               if (verbosity > QUIET)\n> +                       printf(\"Updating %s..%s\\n\",\n> +                               hex,\n> +                               find_unique_abbrev(remoteheads->item->object.sha1,\n> +                               DEFAULT_ABBREV));\n>                strbuf_addstr(&msg, \"Fast forward\");\n>                if (have_message)\n>                        strbuf_addstr(&msg,\n> diff --git a/git-pull.sh b/git-pull.sh\n> index 664fe34..8866f2a 100755\n> --- a/git-pull.sh\n> +++ b/git-pull.sh\n> @@ -16,13 +16,17 @@ cd_to_toplevel\n>  test -z \"$(git ls-files -u)\" ||\n>        die \"You are in the middle of a conflicted merge.\"\n>\n> -strategy_args= no_stat= no_commit= squash= no_ff= log_arg=\n> +strategy_args= no_stat= no_commit= squash= no_ff= log_arg= verbosity=\n>  curr_branch=$(git symbolic-ref -q HEAD)\n>  curr_branch_short=$(echo \"$curr_branch\" | sed \"s|refs/heads/||\")\n>  rebase=$(git config --bool branch.$curr_branch_short.rebase)\n>  while :\n>  do\n>        case \"$1\" in\n> +       -q|--quiet)\n> +               verbosity=-q ;;\n> +       -v|--verbose)\n> +               verbosity=-v ;;\n>        -n|--no-stat|--no-summary)\n>                no_stat=-n ;;\n>        --stat|--summary)\n> @@ -121,7 +125,7 @@ test true = \"$rebase\" && {\n>                \"refs/remotes/$origin/$reflist\" 2>/dev/null)\"\n>  }\n>  orig_head=$(git rev-parse --verify HEAD 2>/dev/null)\n> -git fetch --update-head-ok \"$@\" || exit 1\n> +git fetch $verbosity --update-head-ok \"$@\" || exit 1\n>\n>  curr_head=$(git rev-parse --verify HEAD 2>/dev/null)\n>  if test -n \"$orig_head\" && test \"$curr_head\" != \"$orig_head\"\n> @@ -182,4 +186,4 @@ test true = \"$rebase\" &&\n>        exec git-rebase $strategy_args --onto $merge_head \\\n>        ${oldremoteref:-$merge_head}\n>  exec git-merge $no_stat $no_commit $squash $no_ff $log_arg $strategy_args \\\n> -       \"$merge_name\" HEAD $merge_head\n> +       \"$merge_name\" HEAD $merge_head $verbosity\n> diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh\n> new file mode 100755\n> index 0000000..83e2e8a\n> --- /dev/null\n> +++ b/t/t5521-pull-options.sh\n> @@ -0,0 +1,60 @@\n> +#!/bin/sh\n> +\n> +test_description='pull options'\n> +\n> +. ./test-lib.sh\n> +\n> +D=`pwd`\n> +\n> +test_expect_success 'setup' '\n> +       mkdir parent &&\n> +       (cd parent && git init &&\n> +        echo one >file && git add file &&\n> +        git commit -m one)\n> +'\n> +\n> +cd \"$D\"\n> +\n> +test_expect_success 'git pull -q' '\n> +       mkdir clonedq &&\n> +       cd clonedq &&\n> +       git pull -q \"$D/parent\" >out 2>err &&\n> +       test ! -s out\n> +'\n> +\n> +cd \"$D\"\n> +\n> +test_expect_success 'git pull' '\n> +       mkdir cloned &&\n> +       cd cloned &&\n> +       git pull \"$D/parent\" >out 2>err &&\n> +       test -s out\n> +'\n> +cd \"$D\"\n> +\n> +test_expect_success 'git pull -v' '\n> +       mkdir clonedv &&\n> +       cd clonedv &&\n> +       git pull -v \"$D/parent\" >out 2>err &&\n> +       test -s out\n> +'\n> +\n> +cd \"$D\"\n> +\n> +test_expect_success 'git pull -v -q' '\n> +       mkdir clonedvq &&\n> +       cd clonedvq &&\n> +       git pull -v -q \"$D/parent\" >out 2>err &&\n> +       test ! -s out\n> +'\n> +\n> +cd \"$D\"\n> +\n> +test_expect_success 'git pull -q -v' '\n> +       mkdir clonedqv &&\n> +       cd clonedqv &&\n> +       git pull -q -v \"$D/parent\" >out 2>err &&\n> +       test -s out\n> +'\n> +\n> +test_done\n> --\n> 1.6.0.2.GIT\n>\n>\n"},{"id":"95626","messageId":"7vy6zon02o.fsf@gitster.siamese.dyndns.org","threadId":"16205","inReplyTo":"4ac8254d0811101543q612917b5ib83e7e657d17ef3c@mail.gmail.com","subject":"Re: [PATCH] Teach/Fix pull/fetch -q/-v options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-12T20:47:27Z","receivedAt":"2008-11-12T20:47:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Tuncer Ayaz\" <tuncer.ayaz@gmail.com> writes:\n\n> On Fri, Nov 7, 2008 at 4:26 AM, Tuncer Ayaz <tuncer.ayaz@gmail.com> wrote:\n>> Implement git-pull --quiet and git-pull --verbose by\n>> adding the options to git-pull and fixing verbosity\n>> handling in git-fetch.\n>\n> Junio,\n>\n> is there anything still missing in this patch?\n> Maybe the name of the test-case is bad.\n\nIt seems to break t7600.\n"},{"id":"95849","messageId":"4ac8254d0811141609k66b7bd6et8a09a64c11ad38f4@mail.gmail.com","threadId":"16205","inReplyTo":"7vy6zon02o.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Teach/Fix pull/fetch -q/-v options","fromName":"Tuncer Ayaz","fromEmail":"tuncer.ayaz@gmail.com","sentAt":"2008-11-15T00:09:01Z","receivedAt":"2008-11-15T00:09:01Z","isPatch":true,"sender":{"key":"tuncer.ayaz@gmail.com","avatar":null},"body":"On Wed, Nov 12, 2008 at 9:47 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Tuncer Ayaz\" <tuncer.ayaz@gmail.com> writes:\n>\n>> On Fri, Nov 7, 2008 at 4:26 AM, Tuncer Ayaz <tuncer.ayaz@gmail.com> wrote:\n>>> Implement git-pull --quiet and git-pull --verbose by\n>>> adding the options to git-pull and fixing verbosity\n>>> handling in git-fetch.\n>>\n>> Junio,\n>>\n>> is there anything still missing in this patch?\n>> Maybe the name of the test-case is bad.\n>\n> It seems to break t7600.\n\nthanks for the good review, it sure does break.\n\nI hadn't noticed it as I didn't compare test results\nof master against my branch and assumed that that\nbreakage is part of common failing tests.\n\nShawn helped me out a little bit with debugging the test scripts\nand I quickly found out that an if clause is wrong.\nthe diff for the last patch to correct it is:\n --- a/builtin-merge.c\n +++ b/builtin-merge.c\n @@ -50,6 +50,7 @@ static unsigned char head[20], stash[20];\n@@ -163,7 +144,7 @@\n\n        argc = parse_options(argc, argv, builtin_merge_options,\n                        builtin_merge_usage, 0);\n-+      if (verbosity > QUIET)\n++      if (verbosity == QUIET)\n +              show_diffstat = 0;\n\n\na corrected patch will arrive here in a minute.\n"}]}