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

Re: [PATCH/GSoC/RFC] fetch: git fetch --deepen

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 13, 2015, 19:42 UTC
Message-ID
<CAPig+cS07W6gtW8L5wbQwZuxSLxb-r0s6KNO4eDO5BYdBDbWjw@mail.gmail.com>
In-Reply-To
<1426251846-1604-1-git-send-email-dongcan.jiang@gmail.com>
On Fri, Mar 13, 2015 at 9:04 AM, Dongcan Jiang <dongcan.jiang@gmail.com> wrote:
Show 19 quoted lines
> This patch is just for discusstion. An option --deepen is added to
> 'git fetch'. When it comes to '--deepen', git should fetch N more
> commits ahead the local shallow commit, where N is indicated by
> '--depth=N'. [1]
> [...]
> Of course, as a patch for discussion, it remains a long way to go
> before being complete.
> [...]
> Signed-off-by: Dongcan Jiang <dongcan.jiang@gmail.com>
> ---
> diff --git a/fetch-pack.c b/fetch-pack.c
> index 655ee64..6f4adca 100644
> --- a/fetch-pack.c
> +++ b/fetch-pack.c
> @@ -295,6 +295,7 @@ static int find_common(struct fetch_pack_args *args,
>                         if (no_done)            strbuf_addstr(&c, " no-done");
>                         if (use_sideband == 2)  strbuf_addstr(&c, " side-band-64k");
>                         if (use_sideband == 1)  strbuf_addstr(&c, " side-band");
> +                       if (args->depth_deepen)  strbuf_addstr(&c, " depth_deepen");
For consistency, should this be "depth-deepen" rather than "depth_deepen"?
Show 14 quoted lines
>                         if (args->use_thin_pack) strbuf_addstr(&c, " thin-pack");
>                         if (args->no_progress)   strbuf_addstr(&c, " no-progress");
>                         if (args->include_tag)   strbuf_addstr(&c, " include-tag");
> diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
> index d78f320..6738006 100755
> --- a/t/t5510-fetch.sh
> +++ b/t/t5510-fetch.sh
> @@ -708,4 +708,15 @@ test_expect_success 'fetching a one-level ref works' '
>         )
>  '
>
> +test_expect_success 'fetching deepen' '
> +       git clone . deepen --depth=1 &&
> +       cd deepen &&

When this tests ends, the working directory will still be 'deepen', which will likely break tests added after this one. If you wrap the 'cd' and following statements in a subshell via '(' and ')', then the 'cd' will affect the subshell but leave the parent shell's working directory alone, and thus not negatively impact subsequent tests.

Show 6 quoted lines
> +       git fetch .. foo --depth=1
> +       git show foo
> +       test_must_fail git show foo~
> +       git fetch .. foo --depth=1 --deepen
> +       git show foo~
> +       test_must_fail git show foo~2
Broken &&-chain throughout.
> +'
> +
>  test_done
Previous: Dongcan JiangNext: Dongcan Jiang
Message 2 of 14 in “fetch: git fetch --deepen”
  1. fetch: git fetch --deepenDongcan Jiang, Mar 13, 2015
  2. Eric SunshineMar 13, 2015
  3. Dongcan JiangMar 16, 2015
  4. Junio C HamanoMar 14, 2015
  5. Duy NguyenMar 14, 2015
  6. Junio C HamanoMar 14, 2015
  7. Dongcan JiangMar 16, 2015
  8. Duy NguyenMar 14, 2015
  9. Dongcan JiangMar 16, 2015
  10. Duy NguyenMar 17, 2015
  11. Dongcan JiangMar 17, 2015
  12. fetch: git fetch --deepenDongcan Jiang, Mar 22, 2015
  13. Eric SunshineMar 22, 2015
  14. Duy NguyenMar 22, 2015

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.