{"thread":{"id":"22791","subject":"[PATCH v2 01/10] Documentation/git-clone: mention progress in -v","startedAt":"2010-02-24T12:50:19Z","lastAt":"2010-02-24T12:50:29Z","messageCount":11,"participants":["Tay Ray Chuan"],"isPatch":true,"patchVersion":2,"patchTotal":10},"messages":[{"id":"135557","messageId":"1267015829-5344-1-git-send-email-rctay89@gmail.com","threadId":"22791","inReplyTo":null,"subject":"[PATCH v2 00/10] teach --progress to transport-related builtins","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-24T12:50:19Z","receivedAt":"2010-02-24T12:50:19Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"This patch series adds --progress to:\n\n  - git-fetch\n  - git-pull\n  - git-push\n\nChanges from v1:\n  - rebased on git/next and resolved a conflict with the recent\n    refactoring of print_push_status() in transports.\n\n  - add a new patch for git-clone's documentation that mentions\n    the effect of the -v/--verbose option on progress reporting.\n\n    This should have been done with 5a518ad (clone: use --progress to\n    force progress reporting), as per Miklos's suggestion\n    (<20091227012032.GE25474@genesis.frugalware.org>).\n\n  - put verbosity options (-v and -q) in a common area for the\n    documentation for git-pull, as per Junio's suggestion\n    (<7vhbpe5jvo.fsf@alter.siamese.dyndns.org>).\n\n  - teach --progress to git-fetch and git-pull in one patch instead of\n    two previously; after all, git-pull is a wrapper of git-fetch.\n\nContents:\n\n[PATCH v2 01/10] Documentation/git-clone: mention progress in -v\n[PATCH v2 02/10] Documentation/git-pull: put verbosity options before merge/fetch ones\n[PATCH v2 03/10] Documentation/git-push: put --quiet before --verbose\n[PATCH v2 04/10] fetch: refactor verbosity option handling into transport.[ch]\n[PATCH v2 05/10] push: support multiple levels of verbosity\n[PATCH v2 06/10] clone: support multiple levels of verbosity\n[PATCH v2 07/10] transport->progress: use flag authoritatively\n[PATCH v2 08/10] push: learn --progress\n[PATCH v2 09/10] fetch and pull: learn --progress\n[PATCH v2 10/10] transport: update flags to be in running order\n\n Documentation/fetch-options.txt |    9 ++++++++-\n Documentation/git-clone.txt     |    3 ++-\n Documentation/git-pull.txt      |   10 ++++++++++\n Documentation/git-push.txt      |   15 +++++++++++----\n Documentation/merge-options.txt |    2 ++\n builtin-clone.c                 |   19 ++++++-------------\n builtin-fetch.c                 |    7 +++----\n builtin-push.c                  |   11 ++++++++---\n git-pull.sh                     |    6 ++++--\n transport-helper.c              |    4 +---\n transport.c                     |   31 ++++++++++++++++++++++++++-----\n transport.h                     |   15 ++++++++++-----\n 12 files changed, 91 insertions(+), 41 deletions(-)\n"},{"id":"135556","messageId":"1267015829-5344-2-git-send-email-rctay89@gmail.com","threadId":"22791","inReplyTo":"1267015829-5344-1-git-send-email-rctay89@gmail.com","subject":"[PATCH v2 01/10] Documentation/git-clone: mention progress in -v","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-24T12:50:20Z","receivedAt":"2010-02-24T12:50:20Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"After 5a518ad (clone: use --progress to force progress reporting),\n-v/--verbose did not affect whether progress status was reported to\nstderr, and users accustomed to using -v to do so since 21188b1\n(Implement git clone -v) may be confused.\n\nMitigate such risks by stating -v does not affect progress in the\ndocumentation.\n\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n\nNew in v2.\n\nThis should have been done with 5a518ad (clone: use --progress to\nforce progress reporting), as per Miklos's suggestion\n(<20091227012032.GE25474@genesis.frugalware.org>).\n\n Documentation/git-clone.txt |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt\nindex 88ea624..75b9848 100644\n--- a/Documentation/git-clone.txt\n+++ b/Documentation/git-clone.txt\n@@ -102,7 +102,8 @@ objects from the source repository into a pack in the cloned repository.\n\n --verbose::\n -v::\n-\tRun verbosely.\n+\tRun verbosely. Does not affect the reporting of progress status\n+\tto the standard error stream.\n\n --progress::\n \tProgress status is reported on the standard error stream\n--\n1.7.0.20.gcb44ed\n"},{"id":"135560","messageId":"1267015829-5344-3-git-send-email-rctay89@gmail.com","threadId":"22791","inReplyTo":"1267015829-5344-1-git-send-email-rctay89@gmail.com","subject":"[PATCH v2 02/10] Documentation/git-pull: put verbosity options before merge/fetch ones","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-24T12:50:21Z","receivedAt":"2010-02-24T12:50:21Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"After 3f7a9b5 (Documentation/git-pull.txt: Add subtitles above included\noption files, Thu Oct 22 2009), the -q/-v options were mentioned only\nfor the merge options section, giving the impression that git-fetch did\nnot take those arguments.\n\nFollow 90e4311 (git-pull: do not mention --quiet and --verbose twice,\nMon Sep 7 2009) and hide -q/-v for merge options, while mentioning -q/-v\nbefore the merge- and fetch-specific options.\n\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n\nChanges from v1:\n  - put verbosity options (-v and -q) in a common area for the\n    documentation for git-pull, as per Junio's suggestion\n    (<7vhbpe5jvo.fsf@alter.siamese.dyndns.org>).\n\n Documentation/git-pull.txt      |    8 ++++++++\n Documentation/merge-options.txt |    2 ++\n 2 files changed, 10 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt\nindex 31f42ea..d47f9dd 100644\n--- a/Documentation/git-pull.txt\n+++ b/Documentation/git-pull.txt\n@@ -31,6 +31,14 @@ in a state that is hard to back out of in the case of a conflict.\n OPTIONS\n -------\n\n+-q::\n+--quiet::\n+\tPass --quiet to git-fetch and git-merge.\n+\n+-v::\n+--verbose::\n+\tPass --verbose to git-fetch and git-merge.\n+\n Options related to merging\n ~~~~~~~~~~~~~~~~~~~~~~~~~~\n\ndiff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\nindex 3b83dba..37ce9a1 100644\n--- a/Documentation/merge-options.txt\n+++ b/Documentation/merge-options.txt\n@@ -67,6 +67,7 @@ option can be used to override --squash.\n \tSynonyms to --stat and --no-stat; these are deprecated and will be\n \tremoved in the future.\n\n+ifndef::git-pull[]\n -q::\n --quiet::\n \tOperate quietly.\n@@ -74,6 +75,7 @@ option can be used to override --squash.\n -v::\n --verbose::\n \tBe verbose.\n+endif::git-pull[]\n\n -X <option>::\n --strategy-option=<option>::\n--\n1.7.0.20.gcb44ed\n"},{"id":"135561","messageId":"1267015829-5344-4-git-send-email-rctay89@gmail.com","threadId":"22791","inReplyTo":"1267015829-5344-1-git-send-email-rctay89@gmail.com","subject":"[PATCH v2 03/10] Documentation/git-push: put --quiet before --verbose","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-24T12:50:22Z","receivedAt":"2010-02-24T12:50:22Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n Documentation/git-push.txt |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 49b6bd9..ddb78eb 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -146,15 +146,15 @@ useful if you write an alias or script around 'git push'.\n \treceiver share many of the same objects in common. The default is\n \t\\--thin.\n \n--v::\n---verbose::\n-\tRun verbosely.\n-\n -q::\n --quiet::\n \tSuppress all output, including the listing of updated refs,\n \tunless an error occurs.\n \n+-v::\n+--verbose::\n+\tRun verbosely.\n+\n include::urls-remotes.txt[]\n \n OUTPUT\n-- \n1.7.0.20.gcb44ed\n"},{"id":"135565","messageId":"1267015829-5344-5-git-send-email-rctay89@gmail.com","threadId":"22791","inReplyTo":"1267015829-5344-1-git-send-email-rctay89@gmail.com","subject":"[PATCH v2 04/10] fetch: refactor verbosity option handling into transport.[ch]","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-24T12:50:23Z","receivedAt":"2010-02-24T12:50:23Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"transport_set_verbosity() is now provided to transport users.\n\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n builtin-fetch.c |    5 +----\n transport.c     |    8 ++++++++\n transport.h     |    1 +\n 3 files changed, 10 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-fetch.c b/builtin-fetch.c\nindex d3b9d8a..a7c7e67 100644\n--- a/builtin-fetch.c\n+++ b/builtin-fetch.c\n@@ -823,10 +823,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)\n \t\tdie(\"Where do you want to fetch from today?\");\n \n \ttransport = transport_get(remote, NULL);\n-\tif (verbosity >= 2)\n-\t\ttransport->verbose = verbosity <= 3 ? verbosity : 3;\n-\tif (verbosity < 0)\n-\t\ttransport->verbose = -1;\n+\ttransport_set_verbosity(transport, verbosity);\n \tif (upload_pack)\n \t\tset_option(TRANS_OPT_UPLOADPACK, upload_pack);\n \tif (keep)\ndiff --git a/transport.c b/transport.c\nindex 1a360cf..54f5ede 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -1012,6 +1012,14 @@ int transport_set_option(struct transport *transport,\n \treturn 1;\n }\n \n+void transport_set_verbosity(struct transport *transport, int verbosity)\n+{\n+\tif (verbosity >= 2)\n+\t\ttransport->verbose = verbosity <= 3 ? verbosity : 3;\n+\tif (verbosity < 0)\n+\t\ttransport->verbose = -1;\n+}\n+\n int transport_push(struct transport *transport,\n \t\t   int refspec_nr, const char **refspec, int flags,\n \t\t   int *nonfastforward)\ndiff --git a/transport.h b/transport.h\nindex 096f6e9..5a5ce3a 100644\n--- a/transport.h\n+++ b/transport.h\n@@ -129,6 +129,7 @@ struct transport *transport_get(struct remote *, const char *);\n  **/\n int transport_set_option(struct transport *transport, const char *name,\n \t\t\t const char *value);\n+void transport_set_verbosity(struct transport *transport, int verbosity);\n \n int transport_push(struct transport *connection,\n \t\t   int refspec_nr, const char **refspec, int flags,\n-- \n1.7.0.20.gcb44ed\n"},{"id":"135558","messageId":"1267015829-5344-6-git-send-email-rctay89@gmail.com","threadId":"22791","inReplyTo":"1267015829-5344-1-git-send-email-rctay89@gmail.com","subject":"[PATCH v2 05/10] push: support multiple levels of verbosity","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-24T12:50:24Z","receivedAt":"2010-02-24T12:50:24Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Remove the flags TRANSPORT_PUSH_QUIET and TRANSPORT_PUSH_VERBOSE; use\ntransport->verbose instead to determine verbosity for pushing.\n\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n builtin-push.c     |    9 ++++++---\n transport-helper.c |    1 -\n transport.c        |    8 ++++----\n transport.h        |    2 --\n 4 files changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/builtin-push.c b/builtin-push.c\nindex 5633f0a..0082dad 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -17,6 +17,7 @@ static const char * const push_usage[] = {\n static int thin;\n static int deleterefs;\n static const char *receivepack;\n+static int verbosity;\n \n static const char **refspec;\n static int refspec_nr;\n@@ -105,13 +106,16 @@ static int push_with_options(struct transport *transport, int flags)\n {\n \tint err;\n \tint nonfastforward;\n+\n+\ttransport_set_verbosity(transport, verbosity);\n+\n \tif (receivepack)\n \t\ttransport_set_option(transport,\n \t\t\t\t     TRANS_OPT_RECEIVEPACK, receivepack);\n \tif (thin)\n \t\ttransport_set_option(transport, TRANS_OPT_THIN, \"yes\");\n \n-\tif (flags & TRANSPORT_PUSH_VERBOSE)\n+\tif (verbosity > 0)\n \t\tfprintf(stderr, \"Pushing to %s\\n\", transport->url);\n \terr = transport_push(transport, refspec_nr, refspec, flags,\n \t\t\t     &nonfastforward);\n@@ -204,8 +208,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n \tint rc;\n \tconst char *repo = NULL;\t/* default repository */\n \tstruct option options[] = {\n-\t\tOPT_BIT('q', \"quiet\", &flags, \"be quiet\", TRANSPORT_PUSH_QUIET),\n-\t\tOPT_BIT('v', \"verbose\", &flags, \"be verbose\", TRANSPORT_PUSH_VERBOSE),\n+\t\tOPT__VERBOSITY(&verbosity),\n \t\tOPT_STRING( 0 , \"repo\", &repo, \"repository\", \"repository\"),\n \t\tOPT_BIT( 0 , \"all\", &flags, \"push all refs\", TRANSPORT_PUSH_ALL),\n \t\tOPT_BIT( 0 , \"mirror\", &flags, \"mirror all refs\",\ndiff --git a/transport-helper.c b/transport-helper.c\nindex f822972..b868ea4 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -576,7 +576,6 @@ static int push_refs(struct transport *transport,\n \tif (buf.len == 0)\n \t\treturn 0;\n \n-\ttransport->verbose = flags & TRANSPORT_PUSH_VERBOSE ? 1 : 0;\n \tstandard_options(transport);\n \n \tif (flags & TRANSPORT_PUSH_DRY_RUN) {\ndiff --git a/transport.c b/transport.c\nindex 54f5ede..f29fd6c 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -786,8 +786,8 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re\n \targs.send_mirror = !!(flags & TRANSPORT_PUSH_MIRROR);\n \targs.force_update = !!(flags & TRANSPORT_PUSH_FORCE);\n \targs.use_thin_pack = data->options.thin;\n-\targs.verbose = !!(flags & TRANSPORT_PUSH_VERBOSE);\n-\targs.quiet = !!(flags & TRANSPORT_PUSH_QUIET);\n+\targs.verbose = (transport->verbose > 0);\n+\targs.quiet = (transport->verbose < 0);\n \targs.dry_run = !!(flags & TRANSPORT_PUSH_DRY_RUN);\n \n \tret = send_pack(&args, data->fd, data->conn, remote_refs,\n@@ -1038,8 +1038,8 @@ int transport_push(struct transport *transport,\n \t\t\ttransport->get_refs_list(transport, 1);\n \t\tstruct ref *local_refs = get_local_heads();\n \t\tint match_flags = MATCH_REFS_NONE;\n-\t\tint verbose = flags & TRANSPORT_PUSH_VERBOSE;\n-\t\tint quiet = flags & TRANSPORT_PUSH_QUIET;\n+\t\tint verbose = (transport->verbose > 0);\n+\t\tint quiet = (transport->verbose < 0);\n \t\tint porcelain = flags & TRANSPORT_PUSH_PORCELAIN;\n \t\tint pretend = flags & TRANSPORT_PUSH_DRY_RUN;\n \t\tint ret, err;\ndiff --git a/transport.h b/transport.h\nindex 5a5ce3a..d5973ee 100644\n--- a/transport.h\n+++ b/transport.h\n@@ -94,9 +94,7 @@ struct transport {\n #define TRANSPORT_PUSH_FORCE 2\n #define TRANSPORT_PUSH_DRY_RUN 4\n #define TRANSPORT_PUSH_MIRROR 8\n-#define TRANSPORT_PUSH_VERBOSE 16\n #define TRANSPORT_PUSH_PORCELAIN 32\n-#define TRANSPORT_PUSH_QUIET 64\n #define TRANSPORT_PUSH_SET_UPSTREAM 128\n #define TRANSPORT_SUMMARY_WIDTH (2 * DEFAULT_ABBREV + 3)\n \n-- \n1.7.0.20.gcb44ed\n"},{"id":"135566","messageId":"1267015829-5344-7-git-send-email-rctay89@gmail.com","threadId":"22791","inReplyTo":"1267015829-5344-1-git-send-email-rctay89@gmail.com","subject":"[PATCH v2 06/10] clone: support multiple levels of verbosity","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-24T12:50:25Z","receivedAt":"2010-02-24T12:50:25Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n builtin-clone.c |   16 ++++++----------\n 1 files changed, 6 insertions(+), 10 deletions(-)\n\ndiff --git a/builtin-clone.c b/builtin-clone.c\nindex 58bacbd..959fe4b 100644\n--- a/builtin-clone.c\n+++ b/builtin-clone.c\n@@ -37,18 +37,17 @@ static const char * const builtin_clone_usage[] = {\n \tNULL\n };\n \n-static int option_quiet, option_no_checkout, option_bare, option_mirror;\n+static int option_no_checkout, option_bare, option_mirror;\n static int option_local, option_no_hardlinks, option_shared, option_recursive;\n static char *option_template, *option_reference, *option_depth;\n static char *option_origin = NULL;\n static char *option_branch = NULL;\n static char *option_upload_pack = \"git-upload-pack\";\n-static int option_verbose;\n+static int option_verbosity;\n static int option_progress;\n \n static struct option builtin_clone_options[] = {\n-\tOPT__QUIET(&option_quiet),\n-\tOPT__VERBOSE(&option_verbose),\n+\tOPT__VERBOSITY(&option_verbosity),\n \tOPT_BOOLEAN(0, \"progress\", &option_progress,\n \t\t\t\"force progress reporting\"),\n \tOPT_BOOLEAN('n', \"no-checkout\", &option_no_checkout,\n@@ -462,7 +461,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\tdie(\"could not create leading directories of '%s'\", git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n-\tinit_db(option_template, option_quiet ? INIT_DB_QUIET : 0);\n+\tinit_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);\n \n \t/*\n \t * At this point, the config exists, so we do not need the\n@@ -526,10 +525,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\t\ttransport_set_option(transport, TRANS_OPT_DEPTH,\n \t\t\t\t\t     option_depth);\n \n-\t\tif (option_quiet)\n-\t\t\ttransport->verbose = -1;\n-\t\telse if (option_verbose)\n-\t\t\ttransport->verbose = 1;\n+\t\ttransport_set_verbosity(transport, option_verbosity);\n \n \t\tif (option_progress)\n \t\t\ttransport->progress = 1;\n@@ -641,7 +637,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\topts.update = 1;\n \t\topts.merge = 1;\n \t\topts.fn = oneway_merge;\n-\t\topts.verbose_update = !option_quiet;\n+\t\topts.verbose_update = (option_verbosity > 0);\n \t\topts.src_index = &the_index;\n \t\topts.dst_index = &the_index;\n \n-- \n1.7.0.20.gcb44ed\n"},{"id":"135562","messageId":"1267015829-5344-8-git-send-email-rctay89@gmail.com","threadId":"22791","inReplyTo":"1267015829-5344-1-git-send-email-rctay89@gmail.com","subject":"[PATCH v2 07/10] transport->progress: use flag authoritatively","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-24T12:50:26Z","receivedAt":"2010-02-24T12:50:26Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Set transport->progress in transport.c::transport_set_verbosity() after\nchecking for the appropriate conditions (eg. --progress, isatty(2)),\nand thereafter use it without having to check again.\n\nThe rules used are as follows (processing aborts when a rule is\nsatisfied):\n\n  1. Report progress, if force_progress is 1 (ie. --progress).\n  2. Don't report progress, if verbosity < 0 (ie. -q/--quiet).\n  3. Report progress if isatty(2) is 1.\n\nThis changes progress reporting behaviour such that if both --progress\nand --quiet are specified, progress is reported.\n\nIn two areas, the logic to determine whether to *not* show progress is\nchanged to simply use the negation of transport->progress. This changes\nbehaviour in some ways (see previous paragraph for details).\n\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n builtin-clone.c    |    5 +----\n builtin-fetch.c    |    2 +-\n builtin-push.c     |    2 +-\n transport-helper.c |    3 +--\n transport.c        |   17 +++++++++++++++--\n transport.h        |   10 ++++++++--\n 6 files changed, 27 insertions(+), 12 deletions(-)\n\ndiff --git a/builtin-clone.c b/builtin-clone.c\nindex 959fe4b..05f8fb4 100644\n--- a/builtin-clone.c\n+++ b/builtin-clone.c\n@@ -525,10 +525,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\t\ttransport_set_option(transport, TRANS_OPT_DEPTH,\n \t\t\t\t\t     option_depth);\n \n-\t\ttransport_set_verbosity(transport, option_verbosity);\n-\n-\t\tif (option_progress)\n-\t\t\ttransport->progress = 1;\n+\t\ttransport_set_verbosity(transport, option_verbosity, option_progress);\n \n \t\tif (option_upload_pack)\n \t\t\ttransport_set_option(transport, TRANS_OPT_UPLOADPACK,\ndiff --git a/builtin-fetch.c b/builtin-fetch.c\nindex a7c7e67..bc3fcf3 100644\n--- a/builtin-fetch.c\n+++ b/builtin-fetch.c\n@@ -823,7 +823,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)\n \t\tdie(\"Where do you want to fetch from today?\");\n \n \ttransport = transport_get(remote, NULL);\n-\ttransport_set_verbosity(transport, verbosity);\n+\ttransport_set_verbosity(transport, verbosity, 0);\n \tif (upload_pack)\n \t\tset_option(TRANS_OPT_UPLOADPACK, upload_pack);\n \tif (keep)\ndiff --git a/builtin-push.c b/builtin-push.c\nindex 0082dad..dce3152 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -107,7 +107,7 @@ static int push_with_options(struct transport *transport, int flags)\n \tint err;\n \tint nonfastforward;\n \n-\ttransport_set_verbosity(transport, verbosity);\n+\ttransport_set_verbosity(transport, verbosity, 0);\n \n \tif (receivepack)\n \t\ttransport_set_option(transport,\ndiff --git a/transport-helper.c b/transport-helper.c\nindex b868ea4..2638781 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -279,9 +279,8 @@ static void standard_options(struct transport *t)\n \tchar buf[16];\n \tint n;\n \tint v = t->verbose;\n-\tint no_progress = v < 0 || (!t->progress && !isatty(2));\n \n-\tset_helper_option(t, \"progress\", !no_progress ? \"true\" : \"false\");\n+\tset_helper_option(t, \"progress\", t->progress ? \"true\" : \"false\");\n \n \tn = snprintf(buf, sizeof(buf), \"%d\", v + 1);\n \tif (n >= sizeof(buf))\ndiff --git a/transport.c b/transport.c\nindex f29fd6c..6d85447 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -526,7 +526,7 @@ static int fetch_refs_via_pack(struct transport *transport,\n \targs.include_tag = data->options.followtags;\n \targs.verbose = (transport->verbose > 0);\n \targs.quiet = (transport->verbose < 0);\n-\targs.no_progress = args.quiet || (!transport->progress && !isatty(2));\n+\targs.no_progress = !transport->progress;\n \targs.depth = data->options.depth;\n \n \tfor (i = 0; i < nr_heads; i++)\n@@ -913,6 +913,8 @@ struct transport *transport_get(struct remote *remote, const char *url)\n \tconst char *helper;\n \tstruct transport *ret = xcalloc(1, sizeof(*ret));\n \n+\tret->progress = isatty(2);\n+\n \tif (!remote)\n \t\tdie(\"No remote provided to transport_get()\");\n \n@@ -1012,12 +1014,23 @@ int transport_set_option(struct transport *transport,\n \treturn 1;\n }\n \n-void transport_set_verbosity(struct transport *transport, int verbosity)\n+void transport_set_verbosity(struct transport *transport, int verbosity,\n+\tint force_progress)\n {\n \tif (verbosity >= 2)\n \t\ttransport->verbose = verbosity <= 3 ? verbosity : 3;\n \tif (verbosity < 0)\n \t\ttransport->verbose = -1;\n+\n+\t/**\n+\t * Rules used to determine whether to report progress (processing aborts\n+\t * when a rule is satisfied):\n+\t *\n+\t *   1. Report progress, if force_progress is 1 (ie. --progress).\n+\t *   2. Don't report progress, if verbosity < 0 (ie. -q/--quiet ).\n+\t *   3. Report progress if isatty(2) is 1.\n+\t **/\n+\ttransport->progress = force_progress || (verbosity >= 0 && isatty(2));\n }\n \n int transport_push(struct transport *transport,\ndiff --git a/transport.h b/transport.h\nindex d5973ee..531731e 100644\n--- a/transport.h\n+++ b/transport.h\n@@ -80,7 +80,12 @@ struct transport {\n \tint (*disconnect)(struct transport *connection);\n \tchar *pack_lockfile;\n \tsigned verbose : 3;\n-\t/* Force progress even if stderr is not a tty */\n+\t/**\n+\t * Transports should not set this directly, and should use this\n+\t * value without having to check isatty(2), -q/--quiet\n+\t * (transport->verbose < 0), etc. - checking has already been done\n+\t * in transport_set_verbosity().\n+\t **/\n \tunsigned progress : 1;\n \t/*\n \t * If transport is at least potentially smart, this points to\n@@ -127,7 +132,8 @@ struct transport *transport_get(struct remote *, const char *);\n  **/\n int transport_set_option(struct transport *transport, const char *name,\n \t\t\t const char *value);\n-void transport_set_verbosity(struct transport *transport, int verbosity);\n+void transport_set_verbosity(struct transport *transport, int verbosity,\n+\tint force_progress);\n \n int transport_push(struct transport *connection,\n \t\t   int refspec_nr, const char **refspec, int flags,\n-- \n1.7.0.20.gcb44ed\n"},{"id":"135564","messageId":"1267015829-5344-9-git-send-email-rctay89@gmail.com","threadId":"22791","inReplyTo":"1267015829-5344-1-git-send-email-rctay89@gmail.com","subject":"[PATCH v2 08/10] push: learn --progress","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-24T12:50:27Z","receivedAt":"2010-02-24T12:50:27Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n Documentation/git-push.txt |    9 ++++++++-\n builtin-push.c             |    4 +++-\n 2 files changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex ddb78eb..59dc8b1 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -149,12 +149,19 @@ useful if you write an alias or script around 'git push'.\n -q::\n --quiet::\n \tSuppress all output, including the listing of updated refs,\n-\tunless an error occurs.\n+\tunless an error occurs. Progress is not reported to the standard\n+\terror stream.\n \n -v::\n --verbose::\n \tRun verbosely.\n \n+--progress::\n+\tProgress status is reported on the standard error stream\n+\tby default when it is attached to a terminal, unless -q\n+\tis specified. This flag forces progress status even if the\n+\tstandard error stream is not directed to a terminal.\n+\n include::urls-remotes.txt[]\n \n OUTPUT\ndiff --git a/builtin-push.c b/builtin-push.c\nindex dce3152..ba9fe49 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -18,6 +18,7 @@ static int thin;\n static int deleterefs;\n static const char *receivepack;\n static int verbosity;\n+static int progress;\n \n static const char **refspec;\n static int refspec_nr;\n@@ -107,7 +108,7 @@ static int push_with_options(struct transport *transport, int flags)\n \tint err;\n \tint nonfastforward;\n \n-\ttransport_set_verbosity(transport, verbosity, 0);\n+\ttransport_set_verbosity(transport, verbosity, progress);\n \n \tif (receivepack)\n \t\ttransport_set_option(transport,\n@@ -223,6 +224,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n \t\tOPT_STRING( 0 , \"exec\", &receivepack, \"receive-pack\", \"receive pack program\"),\n \t\tOPT_BIT('u', \"set-upstream\", &flags, \"set upstream for git pull/status\",\n \t\t\tTRANSPORT_PUSH_SET_UPSTREAM),\n+\t\tOPT_BOOLEAN(0, \"progress\", &progress, \"force progress reporting\"),\n \t\tOPT_END()\n \t};\n \n-- \n1.7.0.20.gcb44ed\n"},{"id":"135559","messageId":"1267015829-5344-10-git-send-email-rctay89@gmail.com","threadId":"22791","inReplyTo":"1267015829-5344-1-git-send-email-rctay89@gmail.com","subject":"[PATCH v2 09/10] fetch and pull: learn --progress","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-24T12:50:28Z","receivedAt":"2010-02-24T12:50:28Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Note that in the documentation for git-pull, documentation for the\n--progress option is displayed under the \"Options related to fetching\"\nsubtitle via fetch-options.txt.\n\nAlso, update the documentation of the -q/--quiet option for git-pull to\nmention its effect on progress reporting during fetching.\n\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n\nChanges from v1:\n  - teach --progress to git-fetch and git-pull in one patch instead of\n    two previously; after all, git-pull is a wrapper of git-fetch.\n\n Documentation/fetch-options.txt |    9 ++++++++-\n Documentation/git-pull.txt      |    4 +++-\n builtin-fetch.c                 |    4 +++-\n git-pull.sh                     |    6 ++++--\n 4 files changed, 18 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt\nindex fe716b2..044ec88 100644\n--- a/Documentation/fetch-options.txt\n+++ b/Documentation/fetch-options.txt\n@@ -78,9 +78,16 @@ ifndef::git-pull[]\n -q::\n --quiet::\n \tPass --quiet to git-fetch-pack and silence any other internally\n-\tused git commands.\n+\tused git commands. Progress is not reported to the standard error\n+\tstream.\n\n -v::\n --verbose::\n \tBe verbose.\n endif::git-pull[]\n+\n+--progress::\n+\tProgress status is reported on the standard error stream\n+\tby default when it is attached to a terminal, unless -q\n+\tis specified. This flag forces progress status even if the\n+\tstandard error stream is not directed to a terminal.\ndiff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt\nindex d47f9dd..ab4de10 100644\n--- a/Documentation/git-pull.txt\n+++ b/Documentation/git-pull.txt\n@@ -33,7 +33,9 @@ OPTIONS\n\n -q::\n --quiet::\n-\tPass --quiet to git-fetch and git-merge.\n+\tThis is passed to both underlying git-fetch to squelch reporting of\n+\tduring transfer, and underlying git-merge to squelch output during\n+\tmerging.\n\n -v::\n --verbose::\ndiff --git a/builtin-fetch.c b/builtin-fetch.c\nindex bc3fcf3..00fded2 100644\n--- a/builtin-fetch.c\n+++ b/builtin-fetch.c\n@@ -28,6 +28,7 @@ enum {\n };\n\n static int all, append, dry_run, force, keep, multiple, prune, update_head_ok, verbosity;\n+static int progress;\n static int tags = TAGS_DEFAULT;\n static const char *depth;\n static const char *upload_pack;\n@@ -57,6 +58,7 @@ static struct option builtin_fetch_options[] = {\n \tOPT_BOOLEAN('k', \"keep\", &keep, \"keep downloaded pack\"),\n \tOPT_BOOLEAN('u', \"update-head-ok\", &update_head_ok,\n \t\t    \"allow updating of HEAD ref\"),\n+\tOPT_BOOLEAN(0, \"progress\", &progress, \"force progress reporting\"),\n \tOPT_STRING(0, \"depth\", &depth, \"DEPTH\",\n \t\t   \"deepen history of shallow clone\"),\n \tOPT_END()\n@@ -823,7 +825,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)\n \t\tdie(\"Where do you want to fetch from today?\");\n\n \ttransport = transport_get(remote, NULL);\n-\ttransport_set_verbosity(transport, verbosity, 0);\n+\ttransport_set_verbosity(transport, verbosity, progress);\n \tif (upload_pack)\n \t\tset_option(TRANS_OPT_UPLOADPACK, upload_pack);\n \tif (keep)\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 38331a8..d45b50c 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -38,7 +38,7 @@ test -z \"$(git ls-files -u)\" || die_conflict\n test -f \"$GIT_DIR/MERGE_HEAD\" && die_merge\n\n strategy_args= diffstat= no_commit= squash= no_ff= ff_only=\n-log_arg= verbosity=\n+log_arg= verbosity= progress=\n merge_args=\n curr_branch=$(git symbolic-ref -q HEAD)\n curr_branch_short=$(echo \"$curr_branch\" | sed \"s|refs/heads/||\")\n@@ -50,6 +50,8 @@ do\n \t\tverbosity=\"$verbosity -q\" ;;\n \t-v|--verbose)\n \t\tverbosity=\"$verbosity -v\" ;;\n+\t--progress)\n+\t\tprogress=--progress ;;\n \t-n|--no-stat|--no-summary)\n \t\tdiffstat=--no-stat ;;\n \t--stat|--summary)\n@@ -214,7 +216,7 @@ test true = \"$rebase\" && {\n \tdone\n }\n orig_head=$(git rev-parse -q --verify HEAD)\n-git fetch $verbosity --update-head-ok \"$@\" || exit 1\n+git fetch $verbosity $progress --update-head-ok \"$@\" || exit 1\n\n curr_head=$(git rev-parse -q --verify HEAD)\n if test -n \"$orig_head\" && test \"$curr_head\" != \"$orig_head\"\n--\n1.7.0.20.gcb44ed\n"},{"id":"135563","messageId":"1267015829-5344-11-git-send-email-rctay89@gmail.com","threadId":"22791","inReplyTo":"1267015829-5344-1-git-send-email-rctay89@gmail.com","subject":"[PATCH v2 10/10] transport: update flags to be in running order","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-24T12:50:29Z","receivedAt":"2010-02-24T12:50:29Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n\nChanges from v1:\n  - Rebased on git/next and resolved a conflict with the recent\n    refactoring of print_push_status() in transports.\n\n transport.h |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/transport.h b/transport.h\nindex 531731e..c61aacf 100644\n--- a/transport.h\n+++ b/transport.h\n@@ -99,8 +99,8 @@ struct transport {\n #define TRANSPORT_PUSH_FORCE 2\n #define TRANSPORT_PUSH_DRY_RUN 4\n #define TRANSPORT_PUSH_MIRROR 8\n-#define TRANSPORT_PUSH_PORCELAIN 32\n-#define TRANSPORT_PUSH_SET_UPSTREAM 128\n+#define TRANSPORT_PUSH_PORCELAIN 16\n+#define TRANSPORT_PUSH_SET_UPSTREAM 32\n #define TRANSPORT_SUMMARY_WIDTH (2 * DEFAULT_ABBREV + 3)\n\n /* Returns a transport suitable for the url */\n--\n1.7.0.20.gcb44ed\n"}]}