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

Re: [PATCH 1/3] clone: do not accept --depth on local clones

From
MMMikael Magnusson <mikachu@gmail.com>
Date
Aug 19, 2010, 20:49 UTC
Message-ID
<AANLkTimouObkUFVff8GQgGy7cDMAHXTDxGQx0gJUOO2Q@mail.gmail.com>
In-Reply-To
<1282214437-16384-1-git-send-email-pclouds@gmail.com>
2010/8/19 Nguyễn Thái Ngọc Duy <pclouds@gmail.com>:
Show 20 quoted lines
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  builtin/clone.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/clone.c b/builtin/clone.c
> index efb1e6f..215c432 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -414,6 +414,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
>                repo = xstrdup(make_absolute_path(repo_name));
>        else
>                repo = repo_name;
> +       is_local = path && !is_bundle;
> +       if (is_local && option_depth)
> +               die("local clone with --depth does not make sense");
>
>        if (argc == 2)
>                dir = xstrdup(argv[1]);

Wouldn't it be more helpful to also say "Use the file:///blabla syntax instead" or just automatically fall back to that protocol when --depth is used?

-- 
Mikael Magnusson
Previous: Nguyen Thai Ngoc DuyNext: Nguyễn Thái Ngọc Duy
Message 7 of 16 in “fully deepening a shallow clone”
  1. Joey HessAug 17, 2010
  2. Nguyen Thai Ngoc DuyAug 18, 2010
  3. Daniel JohnsonAug 18, 2010
  4. 1/3 clone: do not accept --depth on local clonesNguyễn Thái Ngọc Duy, Aug 19, 2010
  5. Daniel JohnsonAug 19, 2010
  6. Nguyen Thai Ngoc DuyAug 19, 2010
  7. Mikael MagnussonAug 19, 2010
  8. 2/3 fetch-pack: use args.shallow to detect shallow clone instead of args.depthNguyễn Thái Ngọc Duy, Aug 19, 2010
  9. 3/3 {fetch,upload}-pack: allow --depth=0 to deepen into full repo againNguyễn Thái Ngọc Duy, Aug 19, 2010
  10. Jakub NarebskiAug 19, 2010
  11. Nguyen Thai Ngoc DuyAug 19, 2010
  12. Jakub NarebskiAug 20, 2010
  13. Ramkumar RamachandraAug 20, 2010
  14. grep -A/-B/-Cinfinity to get full contextJonathan Nieder, Aug 20, 2010
  15. Ramkumar RamachandraAug 20, 2010
  16. Joey HessAug 18, 2010

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.