From: Dragan Simic Date: Mon, 29 Apr 2024 05:59:52 GMT Subject: Re: [PATCH v2 1/1] advice: add --no-advice global option Message-ID: <4991578233e75f5a9f096b701c4b5efd@manjaro.org> In-Reply-To: <809a1452fb18a6c03d9e8ed516d5c9c0@manjaro.org> On 2024-04-29 07:36, Dragan Simic wrote: > On 2024-04-29 07:01, James Liu wrote: >> Thanks for the feedback Dragan! > > Thank you for working on the patch. > >>> After having a more detailed look at the Git documentation, >>> I think that adding support for "--advice" at the same time >>> would be the right thing to do. That option would override >>> all "advice." options that may exist in the configuration >>> (and would override the GIT_NO_ADVICE environment variable, >>> if we end up supporting it), similarly to how "--paginate" >>> overrides all "pager." in the configuration, which would >>> be both consistent and rather useful in some situations. >> >> I think this makes sense from a UX consistenty perspective, but I'm >> not >> sure if we should increase the scope of this patch. It's also much >> easier to re-enable previously silenced advice hints, so I'm unsure >> whether an --advice option makes sense. We can also avoid the decision >> of what to do if the user supplies --advice and --no-advice >> simultaneously if we only have one option. > > Regarding what to do if those two options are both supplied, > it's simple, just error out with an appropriate error message. > There are already similar situations in the code, e.g. with > the -k and --rfc options for git-format-patch(1). Actually, the -p/--paginate and -P/--no-pager options can currently be supplied together, which isn't the expected behavior. I'm preparing a patch that will cover this as a case of the mutual option exclusivity.