Subject: Re: [PATCH v8 0/3] Cloning with remote unborn HEAD

From: Junio C Hamano <[email-masked]>
Date: Sat, 06 Feb 2021 10:51:56 -0800

Jonathan Tan <[email-masked]> writes:

> Peff sent a review (which I don't see in lore.kernel.org/git, but I do
> see it in my inbox); here's v8 in response to that.
>
> As you can see from the range-diff, there are just minor changes to v7
> (wording in documentation and a memory leak fix).
>
> Jonathan Tan (3):
>   ls-refs: report unborn targets of symrefs
>   connect, transport: encapsulate arg in struct
>   clone: respect remote unborn HEAD

Queued and pushed out, but with vger.kernel.org seem to be delaying
messages randomly, I'll hold off for a few days before merging them
down to 'next'.  To me this version looks good (at least good enough
to cook in 'next' and details can be tweaked incrementally).

Thanks.

>  Documentation/config.txt                |  2 +
>  Documentation/config/init.txt           |  2 +-
>  Documentation/config/lsrefs.txt         |  9 +++
>  Documentation/technical/protocol-v2.txt | 11 +++-
>  builtin/clone.c                         | 34 +++++++++---
>  builtin/fetch-pack.c                    |  3 +-
>  builtin/fetch.c                         | 18 +++---
>  builtin/ls-remote.c                     |  9 +--
>  connect.c                               | 32 ++++++++++-
>  ls-refs.c                               | 74 ++++++++++++++++++++++++-
>  ls-refs.h                               |  1 +
>  remote.h                                |  4 +-
>  serve.c                                 |  2 +-
>  t/t5606-clone-options.sh                |  8 ++-
>  t/t5701-git-serve.sh                    |  2 +-
>  t/t5702-protocol-v2.sh                  | 25 +++++++++
>  transport-helper.c                      |  5 +-
>  transport-internal.h                    | 10 +---
>  transport.c                             | 23 ++++----
>  transport.h                             | 29 +++++++---
>  20 files changed, 240 insertions(+), 63 deletions(-)
>  create mode 100644 Documentation/config/lsrefs.txt
>
> Range-diff against v7:
> 1:  2d35075369 ! 1:  8b0f55b5e4 ls-refs: report unborn targets of symrefs
>     @@ Documentation/config/lsrefs.txt (new)
>      +	protocol v2 capability advertisement. "allow" is the same as
>      +	"advertise" except that the server will not advertise support for this
>      +	feature; this is useful for load-balanced servers that cannot be
>     -+	updated automatically (for example), since the administrator could
>     ++	updated atomically (for example), since the administrator could
>      +	configure "allow", then after a delay, configure "advertise".
>      
>       ## Documentation/technical/protocol-v2.txt ##
>     @@ ls-refs.c
>      +
>      +static void ensure_config_read(void)
>      +{
>     -+	char *str = NULL;
>     ++	const char *str = NULL;
>      +
>      +	if (config_read)
>      +		return;
>      +
>     -+	if (repo_config_get_string(the_repository, "lsrefs.unborn", &str)) {
>     ++	if (repo_config_get_string_tmp(the_repository, "lsrefs.unborn", &str)) {
>      +		/*
>      +		 * If there is no such config, advertise and allow it by
>      +		 * default.
> 2:  d4ed13d02e = 2:  f09bd56d5f connect, transport: encapsulate arg in struct
> 3:  a3e5a0a7c5 = 3:  a5495a42f1 clone: respect remote unborn HEAD