merge-ort: provide helpful submodule update message when possible

In commit 4057523a40 ("submodule merge: update conflict error message", 2022-08-04), a more detailed message was provided when submodules conflict, in order to help users know how to resolve those conflicts. There were a couple situations for which a different message would be more appropriate, but that commit left handling those for future work. Unfortunately, that commit would check if any submodules were of the type that it didn't know how to explain, and, if so, would avoid providing the more detailed explanation even for the submodules it did know how to explain. Change this to have the code print the helpful messages for the subset of submodules it knows how to explain. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Aug 18, 2022 at 07:15 UTC 565577ed883057d9935cfc56e33be8d4abd9a2fc
1 file changed +7 -11
merge-ort.c
+7 -11
@@ -4490,21 +4490,17 @@ static void print_submodule_conflict_suggestion(struct string_list *csub) {
4490 if (!csub->nr)
4491 return;
4492
4493 - /*
4494 - * NEEDSWORK: The steps to resolve these errors deserve a more
4495 - * detailed explanation than what is currently printed below.
4496 - */
4493 + strbuf_add_separated_string_list(&subs, " ", csub);
4494 for_each_string_list_item(item, csub) {
4495 struct conflicted_submodule_item *util = item->util;
4496
4497 + /*
4498 + * NEEDSWORK: The steps to resolve these errors deserve a more
4499 + * detailed explanation than what is currently printed below.
4500 + */
4501 if (util->flag == CONFLICT_SUBMODULE_NOT_INITIALIZED ||
4501 - util->flag == CONFLICT_SUBMODULE_HISTORY_NOT_AVAILABLE)
4502 - return;
4503 - }
4504 -
4505 - strbuf_add_separated_string_list(&subs, " ", csub);
4506 - for_each_string_list_item(item, csub) {
4507 - struct conflicted_submodule_item *util = item->util;
4502 + util->flag == CONFLICT_SUBMODULE_HISTORY_NOT_AVAILABLE)
4503 + continue;
4504
4505 /*
4506 * TRANSLATORS: This is a line of advice to resolve a merge