@matheusbsbs / matheus-bagliano / commits / 9839018e87
Fork 0

fetch and pull: learn --progress

Note that in the documentation for git-pull, documentation for the --progress option is displayed under the "Options related to fetching" subtitle via fetch-options.txt. Also, update the documentation of the -q/--quiet option for git-pull to mention its effect on progress reporting during fetching. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Tay Ray Chuan committed Feb 24, 2010 at 20:50 UTC 9839018e874d4f15e820e1272f1ac575186c4fdc
4 files changed +18 -5
Documentation/fetch-options.txt
+8 -1
@@ -78,9 +78,16 @@ ifndef::git-pull[]
78 -q::
79 --quiet::
80 Pass --quiet to git-fetch-pack and silence any other internally
81 - used git commands.
81 + used git commands. Progress is not reported to the standard error
82 + stream.
83
84 -v::
85 --verbose::
86 Be verbose.
87 endif::git-pull[]
88 +
89 +--progress::
90 + Progress status is reported on the standard error stream
91 + by default when it is attached to a terminal, unless -q
92 + is specified. This flag forces progress status even if the
93 + standard error stream is not directed to a terminal.
Documentation/git-pull.txt
+3 -1
@@ -33,7 +33,9 @@ OPTIONS
33
34 -q::
35 --quiet::
36 - Pass --quiet to git-fetch and git-merge.
36 + This is passed to both underlying git-fetch to squelch reporting of
37 + during transfer, and underlying git-merge to squelch output during
38 + merging.
39
40 -v::
41 --verbose::
builtin-fetch.c
+3 -1
@@ -27,6 +27,7 @@ enum {
27 };
28
29 static int all, append, dry_run, force, keep, multiple, prune, update_head_ok, verbosity;
30 +static int progress;
31 static int tags = TAGS_DEFAULT;
32 static const char *depth;
33 static const char *upload_pack;
@@ -56,6 +57,7 @@ static struct option builtin_fetch_options[] = {
57 OPT_BOOLEAN('k', "keep", &keep, "keep downloaded pack"),
58 OPT_BOOLEAN('u', "update-head-ok", &update_head_ok,
59 "allow updating of HEAD ref"),
60 + OPT_BOOLEAN(0, "progress", &progress, "force progress reporting"),
61 OPT_STRING(0, "depth", &depth, "DEPTH",
62 "deepen history of shallow clone"),
63 OPT_END()
@@ -823,7 +825,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
825 die("Where do you want to fetch from today?");
826
827 transport = transport_get(remote, NULL);
826 - transport_set_verbosity(transport, verbosity, 0);
828 + transport_set_verbosity(transport, verbosity, progress);
829 if (upload_pack)
830 set_option(TRANS_OPT_UPLOADPACK, upload_pack);
831 if (keep)
git-pull.sh
+4 -2
@@ -38,7 +38,7 @@ test -z "$(git ls-files -u)" || die_conflict
38 test -f "$GIT_DIR/MERGE_HEAD" && die_merge
39
40 strategy_args= diffstat= no_commit= squash= no_ff= ff_only=
41 -log_arg= verbosity=
41 +log_arg= verbosity= progress=
42 merge_args=
43 curr_branch=$(git symbolic-ref -q HEAD)
44 curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
@@ -50,6 +50,8 @@ do
50 verbosity="$verbosity -q" ;;
51 -v|--verbose)
52 verbosity="$verbosity -v" ;;
53 + --progress)
54 + progress=--progress ;;
55 -n|--no-stat|--no-summary)
56 diffstat=--no-stat ;;
57 --stat|--summary)
@@ -214,7 +216,7 @@ test true = "$rebase" && {
216 done
217 }
218 orig_head=$(git rev-parse -q --verify HEAD)
217 -git fetch $verbosity --update-head-ok "$@" || exit 1
219 +git fetch $verbosity $progress --update-head-ok "$@" || exit 1
220
221 curr_head=$(git rev-parse -q --verify HEAD)
222 if test -n "$orig_head" && test "$curr_head" != "$orig_head"