git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 02/16] update-index: convert advise() messages back to warning()

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 14, 2022, 06:08 UTC
Message-ID
<xmqq5yoht6an.fsf@gitster.g>
In-Reply-To
<b120972a441d3081519af0e31bb0c639df148287.1647033303.git.gitgitgadget@gmail.com>
"Jeff Hostetler via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Jeff Hostetler <jeffhost@microsoft.com>
>
> fixup! update-index: convert fsmonitor warnings to advise

Same comment as 01/16 applies here. "convert ... back to ..." in the title refers to the fact that builtin-fsmonitor-part2 topic turned warning() into advise() without a good justification, I think. Flipping and flopping between warning and advise, without giving any justification going either direction, is not a good move.

I only have looked at one eighth of this part 2.5, but it starts to look that ejecting part-2 and redoing it may result in a cleaner code that is easier to understand, perhaps? For example, instead of applying this patch, we can just get rid of 1a9241e1 (update-index: convert fsmonitor warnings to advise, 2022-03-01). As I read more, my impression will certainly change, I would expect. Let's see.

Show 34 quoted lines
> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
> ---
>  builtin/update-index.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/builtin/update-index.c b/builtin/update-index.c
> index d335f1ac72a..75d646377cc 100644
> --- a/builtin/update-index.c
> +++ b/builtin/update-index.c
> @@ -1238,18 +1238,18 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
>  	if (fsmonitor > 0) {
>  		enum fsmonitor_mode fsm_mode = fsm_settings__get_mode(r);
>  		if (fsm_mode == FSMONITOR_MODE_DISABLED) {
> -			advise(_("core.fsmonitor is unset; "
> -				 "set it if you really want to "
> -				 "enable fsmonitor"));
> +			warning(_("core.fsmonitor is unset; "
> +				  "set it if you really want to "
> +				  "enable fsmonitor"));
>  		}
>  		add_fsmonitor(&the_index);
>  		report(_("fsmonitor enabled"));
>  	} else if (!fsmonitor) {
>  		enum fsmonitor_mode fsm_mode = fsm_settings__get_mode(r);
>  		if (fsm_mode > FSMONITOR_MODE_DISABLED)
> -			advise(_("core.fsmonitor is set; "
> -				 "remove it if you really want to "
> -				 "disable fsmonitor"));
> +			warning(_("core.fsmonitor is set; "
> +				  "remove it if you really want to "
> +				  "disable fsmonitor"));
>  		remove_fsmonitor(&the_index);
>  		report(_("fsmonitor disabled"));
>  	}
Previous: Jeff Hostetler via GitGitGadgetNext: Jeff Hostetler
Message 10 of 32 in “Builtin FSMonitor Part 2.5”
  1. 00/16 Builtin FSMonitor Part 2.5Jeff Hostetler via GitGitGadget, Mar 11, 2022
  2. 01/16 t/test-lib: avoid using git on LHS of pipeJeff Hostetler via GitGitGadget, Mar 11, 2022
  3. Junio C HamanoMar 14, 2022
  4. 05/16 fsmonitor--daemon: refactor cookie handling for readabilityJeff Hostetler via GitGitGadget, Mar 11, 2022
  5. Ævar Arnfjörð BjarmasonMar 14, 2022
  6. Derrick StoleeMar 14, 2022
  7. Junio C HamanoMar 14, 2022
  8. Jeff HostetlerMar 21, 2022
  9. 02/16 update-index: convert advise() messages back to warning()Jeff Hostetler via GitGitGadget, Mar 11, 2022
  10. Junio C HamanoMar 14, 2022
  11. Jeff HostetlerMar 21, 2022
  12. 10/16 t7527: delete unused verify_status() functionJeff Hostetler via GitGitGadget, Mar 11, 2022
  13. 11/16 fsmonitor-ipc: add _() to calls to die()Jeff Hostetler via GitGitGadget, Mar 11, 2022
  14. 15/16 fsmonitor--daemon: add _() to calls to error()Jeff Hostetler via GitGitGadget, Mar 11, 2022
  15. 12/16 compat/fsmonitor/fsm-listen-darwin: add _() to calls to error()Jeff Hostetler via GitGitGadget, Mar 11, 2022
  16. 03/16 compat/fsmonitor/fsm-listen-darwin: split out GCC-specific declarationsJeff Hostetler via GitGitGadget, Mar 11, 2022
  17. 06/16 t/perf/p7519: use grep rather than egrep in testJeff Hostetler via GitGitGadget, Mar 11, 2022
  18. 07/16 t/perf/p7519: cleanup coding styleJeff Hostetler via GitGitGadget, Mar 11, 2022
  19. Ævar Arnfjörð BjarmasonMar 14, 2022
  20. 14/16 fsmonitor--daemon: add _() to calls to die()Jeff Hostetler via GitGitGadget, Mar 11, 2022
  21. 09/16 t7527: fix && chaining in matrix_try()Jeff Hostetler via GitGitGadget, Mar 11, 2022
  22. Junio C HamanoMar 14, 2022
  23. 08/16 t7527: add parameters to start_daemon to handle args and subshellJeff Hostetler via GitGitGadget, Mar 11, 2022
  24. Ævar Arnfjörð BjarmasonMar 14, 2022
  25. 04/16 t/helper/fsmonitor-client: cleanup call to parse_options()Jeff Hostetler via GitGitGadget, Mar 11, 2022
  26. Ævar Arnfjörð BjarmasonMar 14, 2022
  27. 13/16 compat/fsmonitor/fsm-listen-win32: add _() to calls to error()Jeff Hostetler via GitGitGadget, Mar 11, 2022
  28. 16/16 fsmonitor-settings: simplify initialization of settings dataJeff Hostetler via GitGitGadget, Mar 11, 2022
  29. Junio C HamanoMar 14, 2022
  30. Jeff HostetlerMar 15, 2022
  31. Junio C HamanoMar 15, 2022
  32. Junio C HamanoMar 13, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.