git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] Port `submodule init` to C

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 14, 2016, 18:26 UTC
Message-ID
<xmqqwpo0f3mw.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1460657909-1329-1-git-send-email-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
> * This applies on another base commit, such that we make use of the tests
>   written in origin/sb/submodule-path-misc-bugs. (I am not sure if I have too
>   many series in flight stomping on each other here)
I actually am quite sure that is the case ;-)
> * This time I actually fix what Ramsay was hinting at:
>   strbuf_detach(&sb, NULL) instead of strbuf_detach(&sb, 0);
Thanks, will take a look.
Show 69 quoted lines
> Where do these patches apply?
> =============================
>
> I ran the following commands for a new starting point of this series:
>
>     git checkout --detach origin/sb/submodule-parallel-update
>     git merge origin/sb/submodule-helper-clone-regression-fix
>     git merge origin/sb/submodule-path-misc-bugs
>
> The second merge produces 2 conflicts, which can be resolved like this:
> (I am unsure about the second comment in strbuf.h though)
> diff --cc builtin/fetch.c
> index 5aa1c2d,e4639d8..0000000
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@@ -37,7 -37,8 +37,8 @@@ static int prune = -1; /* unspecified *
>   static int all, append, dry_run, force, keep, multiple, update_head_ok, verbosity;
>   static int progress = -1, recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
>   static int tags = TAGS_DEFAULT, unshallow, update_shallow;
>  -static int max_children = 1;
>  +static int max_children = -1;
> + static enum transport_family family;
>   static const char *depth;
>   static const char *upload_pack;
>   static struct strbuf default_rla = STRBUF_INIT;
> diff --cc strbuf.h
> index d4f2aa1,f72fd14..0000000
> --- a/strbuf.h
> +++ b/strbuf.h
> @@@ -387,15 -387,10 +387,16 @@@ extern ssize_t strbuf_read_file(struct 
>   extern int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint);
>   
>   /**
>  + * Write the whole content of the strbuf to the stream not stopping at
>  + * NUL bytes.
>  + */
>  +extern ssize_t strbuf_write(struct strbuf *sb, FILE *stream);
>  +
>  +/**
> -  * Read a line from a FILE *, overwriting the existing contents
> -  * of the strbuf. The second argument specifies the line
> -  * terminator character, typically `'\n'`.
> +  * Read a line from a FILE *, overwriting the existing contents of
> +  * the strbuf.  The strbuf_getline*() family of functions share
> +  * this signature, but have different line termination conventions.
> +  *
>    * Reading stops after the terminator or at EOF.  The terminator
>    * is removed from the buffer before returning.  Returns 0 unless
>    * there was nothing left before EOF, in which case it returns `EOF`.
>
> As sb/submodule-parallel-update and sb/submodule-helper-clone-regression-fix
> both touch builtin/submodule--helper.c, so we need those.
>
> We need origin/sb/submodule-path-misc-bugs as it tests `submodule add`
> output.
>
> Thanks,
> Stefan
>
> Stefan Beller (2):
>   submodule: port resolve_relative_url from shell to C
>   submodule: port init from shell to C
>
>  builtin/submodule--helper.c | 322 +++++++++++++++++++++++++++++++++++++++++++-
>  git-submodule.sh            | 127 +----------------
>  submodule.c                 |  21 +++
>  submodule.h                 |   1 +
>  t/t0060-path-utils.sh       |  43 ++++++
>  5 files changed, 392 insertions(+), 122 deletions(-)
Previous: Stefan Beller
Message 6 of 6 in “Port `submodule init` to C”
  1. 0/2 Port `submodule init` to CStefan Beller, Apr 14, 2016
  2. 1/2 submodule: port resolve_relative_url from shell to CStefan Beller, Apr 14, 2016
  3. Johannes SixtApr 14, 2016
  4. Stefan BellerApr 14, 2016
  5. 2/2 submodule: port init from shell to CStefan Beller, Apr 14, 2016
  6. Junio C HamanoApr 14, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.