From: Junio C Hamano Date: Tue, 9 Apr 2019 17:14:26 +0000 (+0900) Subject: Merge branch 'jt/submodule-fetch-errmsg' X-Git-Tag: v2.22.0-rc0~121 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/32414ceb854de44a9b4b74c975ae410713a17c99?ds=inline;hp=-c Merge branch 'jt/submodule-fetch-errmsg' Error message update. * jt/submodule-fetch-errmsg: submodule: explain first attempt failure clearly --- 32414ceb854de44a9b4b74c975ae410713a17c99 diff --combined git-submodule.sh index 514ede2596,cc750b57b2..2c0fb6d723 --- a/git-submodule.sh +++ b/git-submodule.sh @@@ -5,8 -5,7 +5,8 @@@ # Copyright (c) 2007 Lars Hjemli dashless=$(basename "$0" | sed -e 's/-/ /') -USAGE="[--quiet] add [-b ] [-f|--force] [--name ] [--reference ] [--] [] +USAGE="[--quiet] [--cached] + or: $dashless [--quiet] add [-b ] [-f|--force] [--name ] [--reference ] [--] [] or: $dashless [--quiet] status [--cached] [--recursive] [--] [...] or: $dashless [--quiet] init [--] [...] or: $dashless [--quiet] deinit [-f|--force] (--all| [--] ...) @@@ -594,7 -593,7 +594,7 @@@ cmd_update( # is not reachable from a ref. is_tip_reachable "$sm_path" "$sha1" || fetch_in_submodule "$sm_path" $depth || - say "$(eval_gettext "Unable to fetch in submodule path '\$displaypath'")" + say "$(eval_gettext "Unable to fetch in submodule path '\$displaypath'; trying to directly fetch \$sha1:")" # Now we tried the usual fetch, but $sha1 may # not be reachable from any of the refs diff --combined submodule.c index 21cf50ca15,b6f6fa72d7..b16c0ecc95 --- a/submodule.c +++ b/submodule.c @@@ -432,10 -432,6 +432,10 @@@ void handle_ignore_submodules_arg(struc diffopt->flags.ignore_dirty_submodules = 1; else if (strcmp(arg, "none")) die("bad --ignore-submodules argument: %s", arg); + /* + * Please update _git_status() in git-completion.bash when you + * add new options + */ } static int prepare_submodule_summary(struct rev_info *rev, const char *path, @@@ -1548,6 -1544,13 +1548,13 @@@ static int fetch_finish(int retvalue, s struct oid_array *commits; if (retvalue) + /* + * NEEDSWORK: This indicates that the overall fetch + * failed, even though there may be a subsequent fetch + * by commit hash that might work. It may be a good + * idea to not indicate failure in this case, and only + * indicate failure if the subsequent fetch fails. + */ spf->result = 1; if (!task || !task->sub) @@@ -1613,12 -1616,11 +1620,12 @@@ int fetch_populated_submodules(struct r calculate_changed_submodule_paths(r, &spf.changed_submodule_names); string_list_sort(&spf.changed_submodule_names); - run_processes_parallel(max_parallel_jobs, - get_next_submodule, - fetch_start_failure, - fetch_finish, - &spf); + run_processes_parallel_tr2(max_parallel_jobs, + get_next_submodule, + fetch_start_failure, + fetch_finish, + &spf, + "submodule", "parallel/fetch"); argv_array_clear(&spf.args); out: