Re: [PATCH 2/5] git-mergetool--lib.sh: use TOOL_MODE when erroring about unknown tool
- From
Philippe Blain <levraiphilippeblain@gmail.com>
- Date
- Nov 22, 2024, 18:57 UTC
- Message-ID
- <c6d95106-e2d9-37d7-211c-b23199ceb258@gmail.com>
- In-Reply-To
- <xmqq34jv3ou2.fsf@gitster.g>
Hi Junio (sorry for a late response),
Le 2024-11-12 à 20:27, Junio C Hamano a écrit :
Show 14 quoted lines
> "Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes: > >> From: Philippe Blain <levraiphilippeblain@gmail.com> >> >> In git-mergetool--lib.sh::get_merge_tool_path, we check if the chosen >> tool is valid via valid_tool and exit with an error message if not. This >> error message mentions "Unknown merge tool", even if the command the >> user tried was 'git difftool --tool=unknown'. Use the global 'TOOL_MODE' >> variable for a more correct error message. > > Makes sense. Is this something we can easily test to catch future > regression, or is it too trivial to matter? > > I wouldn't mind if the answer were "the latter" ;-)
With the changes in the next commit of the series, this particular error becomes hard to trigger, as setup_user_tool will return with an error before the error message change in this patch is reached. So I would way it is not worth to add a test for this particular code path since it seems like it becomes unreachable in the next commit (but I could be wrong). So mostly "the latter" is my answer.
Thanks, Philippe.