Re: [PATCH 0/2] advice: add "all" option to disable all hints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 24, 2024 at 02:52:39PM +0100, Phillip Wood wrote:
> Hi Patrick
> 
> On 24/04/2024 07:48, Patrick Steinhardt wrote:
> > On Tue, Apr 23, 2024 at 11:28:03PM -0700, Junio C Hamano wrote:
> > > Do not close that communication channel on us.
> > 
> > While I agree that it might not be a good idea to set it for our users,
> > the usecase mentioned by this patch series is scripting. And here I very
> > much agree with the sentiment that it makes sense to give an easy knob
> > to disable all advice (disclosure: James is part of the Gitaly team at
> > GitLab, and that is where this feature comes from, so I am very much
> > biased).
> 
> Maybe an environment variable would be a better fit for turning advice off
> in scripts?

Sure, an environment variable would work just fine for our purposes. It
would probably also address the concern that users may disable all
advice and then miss out on some information.

> > It has happened multiple times to us that new advices were introduced
> > that then subsequently caused regressions in Gitaly because the output
> > of Git commands now looks different. While addressing such breakage is
> > easy enough to do, it does add up if we have to run Git with every
> > single advice that we may hit turned off individually.
> 
> I'm sure you've considered these suggestions but (a) would it be possible
> for Gitaly to filter out lines beginning with "hint: " when it captures the
> output of commands and (b) would it be possible to have a script that parses
> advice_setting in advice.c to find the list of advice names so Gitaly can
> disable them? I think (a) would still leave some advice output from code
> that uses advice_enabled() rather than advise_if_enabled() but it should get
> rid of most of the advice messages.

Filtering out advices would be doable. But we probably wouldn't want to
do so unconditionally whenever we execute Git commands. Which would
bring us back to the point where we have to address these new advices
whenever they come up, and it wouldn't be much less verbose than to just
disable advices we face.

Patrick

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux