diff options
author | Jeff King <peff@peff.net> | 2013-09-18 16:05:13 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-18 13:34:12 -0700 |
commit | 68b939b2f097b6675c4aaa178655559aa81b25cb (patch) | |
tree | 1c7fa9e2264491ead3357f6b8b33ae65f56ccb16 /builtin | |
parent | e230c568c4b9a991e3175e5f65171a566fd8e39c (diff) | |
download | git-68b939b2f097b6675c4aaa178655559aa81b25cb.tar.gz git-68b939b2f097b6675c4aaa178655559aa81b25cb.tar.xz |
clone: send diagnostic messages to stderr
Putting messages like "Cloning into.." and "done" on stdout
is un-Unix and uselessly clutters the stdout channel. Send
them to stderr.
We have to tweak two tests to accommodate this:
1. t5601 checks for doubled output due to forking, and
doesn't actually care where the output goes; adjust it
to check stderr.
2. t5702 is trying to test whether progress output was
sent to stderr, but naively does so by checking
whether stderr produced any output. Instead, have it
look for "%", a token found in progress output but not
elsewhere (and which lets us avoid hard-coding the
progress text in the test).
This should not regress any scripts that try to parse the
current output, as the output is already internationalized
and therefore unstable.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/clone.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 430307b29..42c40f2bf 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -380,7 +380,7 @@ static void clone_local(const char *src_repo, const char *dest_repo) } if (0 <= option_verbosity) - printf(_("done.\n")); + fprintf(stderr, _("done.\n")); } static const char *junk_work_tree; @@ -552,12 +552,12 @@ static void update_remote_refs(const struct ref *refs, if (check_connectivity) { if (0 <= option_verbosity) - printf(_("Checking connectivity... ")); + fprintf(stderr, _("Checking connectivity... ")); if (check_everything_connected_with_transport(iterate_ref_map, 0, &rm, transport)) die(_("remote did not send all necessary objects")); if (0 <= option_verbosity) - printf(_("done\n")); + fprintf(stderr, _("done\n")); } if (refs) { @@ -850,9 +850,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix) if (0 <= option_verbosity) { if (option_bare) - printf(_("Cloning into bare repository '%s'...\n"), dir); + fprintf(stderr, _("Cloning into bare repository '%s'...\n"), dir); else - printf(_("Cloning into '%s'...\n"), dir); + fprintf(stderr, _("Cloning into '%s'...\n"), dir); } init_db(option_template, INIT_DB_QUIET); write_config(&option_config); |