Subject: Re: [PATCH v3 09/28] shallow.c: extend setup_*_shallow() to accept extra shallow points

From: Junio C Hamano <[email-masked]>
Date: Mon, 25 Nov 2013 14:25:15 -0800

Nguyễn Thái Ngọc Duy  <[email-masked]> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>
> ---
>  commit.h      |  8 +++++---
>  fetch-pack.c  |  5 +++--
>  shallow.c     | 20 +++++++++++++++-----
>  upload-pack.c |  2 +-
>  4 files changed, 24 insertions(+), 11 deletions(-)
>
> diff --git a/commit.h b/commit.h
> index e1fd587..3af4699 100644
> --- a/commit.h
> +++ b/commit.h
> @@ -203,10 +203,12 @@ extern struct commit_list *get_shallow_commits(struct object_array *heads,
>  		int depth, int shallow_flag, int not_shallow_flag);
>  extern void check_shallow_file_for_update(void);
>  extern void set_alternate_shallow_file(const char *path);
> -extern int write_shallow_commits(struct strbuf *out, int use_pack_protocol);
> +extern int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
> +				 const struct extra_have_objects *extra);

Confusing.

Sounds as if you got the extra ".have" and storing them in the
.git/shallow file (which of course would not make much sense), which
is not what is going on.

Also it is unclear how the sanity check the previous step seems to
make and the new list of shallow commit names this patch adds to
existing functions are designed to interact. I think the whole
design needs a better explanation of the flow at the higher level.