Re: [PATCH v2 5/6] bundle: get (mostly) rid of `the_repository`

Junio C Hamano <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
Patrick Steinhardt <[email protected]> writes:

> Refactor "bundle.c" so that we don't depend on `the_repository` anymore.
> This conversion is trivial for most of the part, as we already have a
> repository available in all calling conexts.
>
> The only exception is that we use `get_log_output_encoding()`, which
> implicitly depends on `the_repository`. Add an `extern` declaration for
> this function so that we can drop `USE_THE_REPOSITORY_VARIABLE` and not
> accidentally introduce more uses of `the_repository`.
>
> Signed-off-by: Patrick Steinhardt <[email protected]>
> ---
>  bundle.c | 32 +++++++++++++++++++++-----------
>  1 file changed, 21 insertions(+), 11 deletions(-)
>
> diff --git a/bundle.c b/bundle.c
> index b64716f252..a9330bf0d3 100644
> --- a/bundle.c
> +++ b/bundle.c
> @@ -1,4 +1,3 @@
> -#define USE_THE_REPOSITORY_VARIABLE
>  #define DISABLE_SIGN_COMPARE_WARNINGS
>  
>  #include "git-compat-util.h"
> @@ -21,6 +20,13 @@
>  #include "connected.h"
>  #include "write-or-die.h"
>  
> +/*
> + * NEEDSWORK: this function implicitly depends on `the_repository` and is not
> + * available because we dropped USE_THE_REPOSITORY_VARIABLE. We can remove the
> + * declaration once it's accessible via `repo_config_values`.
> + */
> +extern const char *get_log_output_encoding(void);
> +

Doesn't this defeat the whole "drop #define USE_THE_REPOSITORY_VARIABLE
as a mark that we are done with this file and no longer need to
worry about it going forward because we won't be able to compile if
somebody adds a new use?" premise?  

We want to omit the above two hunks, even though the rest of the
patch look perfectly good.

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.