git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Ben Boeckel <mathstuf@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v1 1/4] advice: add a function to set the value of an advice type
Date: Mon, 2 Aug 2021 23:56:09 +0200 (CEST)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.2108022353110.55@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <20210731022504.1912702-2-mathstuf@gmail.com>

Hi Ben,

On Fri, 30 Jul 2021, Ben Boeckel wrote:

> This is setup for removing the `advice` global variables.

The idea to separate out this patch from the rest was probably to make
things easier to review.

However, without any callers of this function, I find it pretty hard to
review it.

My recommendation would be to move the addition of all the callers of this
function from 3/4 here (obviously without removing the assignments of the
global variables, that removal should stay with 3/4).

Ciao,
Dscho

>
> Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
> ---
>  advice.c | 5 +++++
>  advice.h | 5 +++++
>  2 files changed, 10 insertions(+)
>
> diff --git a/advice.c b/advice.c
> index 0b9c89c48a..fd58631dc1 100644
> --- a/advice.c
> +++ b/advice.c
> @@ -187,6 +187,11 @@ int advice_enabled(enum advice_type type)
>  	}
>  }
>
> +void advice_set(enum advice_type type, int value)
> +{
> +	advice_setting[type].enabled = value;
> +}
> +
>  void advise_if_enabled(enum advice_type type, const char *advice, ...)
>  {
>  	va_list params;
> diff --git a/advice.h b/advice.h
> index bd26c385d0..74425a9f1a 100644
> --- a/advice.h
> +++ b/advice.h
> @@ -87,6 +87,11 @@ void advise(const char *advice, ...);
>   */
>  int advice_enabled(enum advice_type type);
>
> +/**
> + * Enable or disable advice of a certain kind.
> + */
> +void advice_set(enum advice_type type, int value);
> +
>  /**
>   * Checks the visibility of the advice before printing.
>   */
> --
> 2.31.1
>
>

  reply	other threads:[~2021-08-02 21:56 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-31  2:25 [PATCH v1 0/4] advice: remove usage of `advice_*` global variables Ben Boeckel
2021-07-31  2:25 ` [PATCH v1 1/4] advice: add a function to set the value of an advice type Ben Boeckel
2021-08-02 21:56   ` Johannes Schindelin [this message]
2021-07-31  2:25 ` [PATCH v1 2/4] advice: add enum variants for missing advice variables Ben Boeckel
2021-08-02 21:52   ` Johannes Schindelin
2021-08-03  0:36     ` Ben Boeckel
2021-07-31  2:25 ` [PATCH v1 3/4] advice: remove uses of global `advice_` variables Ben Boeckel
2021-08-02 22:06   ` Johannes Schindelin
2021-08-03  0:42     ` Ben Boeckel
2021-07-31  2:25 ` [PATCH v1 4/4] advice: remove static global variables for advice tracking Ben Boeckel
2021-08-02 22:09   ` Johannes Schindelin
2021-08-03  0:44     ` Ben Boeckel
2021-08-02 22:15 ` [PATCH v1 0/4] advice: remove usage of `advice_*` global variables Johannes Schindelin
2021-08-03  0:45   ` Ben Boeckel
2021-08-05 23:03 ` [PATCH v2 " Ben Boeckel
2021-08-05 23:03   ` [PATCH v2 1/4] advice: add enum variants for missing advice variables Ben Boeckel
2021-08-05 23:03   ` [PATCH v2 2/4] advice: remove read uses of global `advice_` variables Ben Boeckel
2021-08-05 23:03   ` [PATCH v2 3/4] advice: add `advice_set` to update advice settings at runtime Ben Boeckel
2021-08-05 23:03   ` [PATCH v2 4/4] advice: remove static global variables for advice tracking Ben Boeckel
2021-08-06 19:13   ` [RFC PATCH v3 0/4] advice: remove usage of `advice_*` global variables Ævar Arnfjörð Bjarmason
2021-08-06 19:13     ` [RFC PATCH v3 1/4] advice: add enum variants for missing advice variables Ævar Arnfjörð Bjarmason
2021-08-06 19:13     ` [RFC PATCH v3 2/4] advice: remove read uses of most global `advice_` variables Ævar Arnfjörð Bjarmason
2021-08-06 19:30       ` Eric Sunshine
2021-08-06 19:13     ` [RFC PATCH v3 3/4] advice: remove use of global advice_add_embedded_repo Ævar Arnfjörð Bjarmason
2021-08-06 20:01       ` Eric Sunshine
2021-08-06 19:13     ` [RFC PATCH v3 4/4] advice: move advice.graftFileDeprecated squashing to commit.[ch] Ævar Arnfjörð Bjarmason
2021-08-23 10:43     ` [PATCH v4 0/4] advice: remove usage of `advice_*` global variables Ævar Arnfjörð Bjarmason
2021-08-23 10:43       ` [PATCH v4 1/4] advice: add enum variants for missing advice variables Ævar Arnfjörð Bjarmason
2021-08-23 10:44       ` [PATCH v4 2/4] advice: remove read uses of most global `advice_` variables Ævar Arnfjörð Bjarmason
2021-08-23 10:44       ` [PATCH v4 3/4] advice: remove use of global advice_add_embedded_repo Ævar Arnfjörð Bjarmason
2021-08-23 10:44       ` [PATCH v4 4/4] advice: move advice.graftFileDeprecated squashing to commit.[ch] Ævar Arnfjörð Bjarmason
2021-08-25 19:07         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.QRO.7.76.6.2108022353110.55@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mathstuf@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).