Re: [PATCH v2] rebase -x: don't print "Executing:" msgs with --quiet
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 19, 2024, 20:17 UTC
- Message-ID
- <xmqqv7zwclns.fsf@gitster.g>
- In-Reply-To
- <08dc334a-e1d9-4aa1-945e-c543de549163@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 11 quoted lines
> On 18/08/2024 14:03, Matheus Tavares Bernardino wrote: >> ... >> term_clean_line()", the correct approach would be to modify >> "term_clean_line()" to return earlier "if (!isatty(1))". What do you >> think? > > On the face of it that sounds like a good idea but I haven't thought > too much about it. These messages are all going to stderr rather than > stdout. If we do go that way we'll need to adjust > launch_specified_editor() in editor.c to either suppress the hint or > terminate it with '\n' if stderr is not a terminal.
Right.
The true reason why I brought it up was because (1) it looked really funny to avoid doing that term_clean_line() under "--verbose" as well as under "--quiet" and the code should explain what reasoning backs such decision but it did not, and (2) that unexplained funny pattern repeated, which probably was a sign that it needed to become a small helper function with descriptive name to encapsulate the logic to decide when to call and when not to call the clean-line, which as a bonus would give a central place for us to explain the reason behind not cleaning the line under "--verbose" and the same for "--quiet" (as I suspect that these two want to omit the call for different reasons).
Thanks.