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

Re: [PATCHv2] clone: add `--shallow-submodules` flag

From
Stefan Beller <sbeller@google.com>
Date
Apr 26, 2016, 17:51 UTC
Message-ID
<CAGZ79kan6bBH236nBvTUdV2KiaB9hW6KOCz_rWqk513CGN30mg@mail.gmail.com>
In-Reply-To
<xmqqtwiogt4y.fsf@gitster.mtv.corp.google.com>
On Tue, Apr 26, 2016 at 10:46 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 47 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>>  I did not rebase this on 85705cfb (Merge branch 'ss/clone-depth-single-doc',
>>  2016-01-20) or later, but worked on it with the base unchanged.
>
> Thanks, will replace.
>
>> diff --git a/t/t5614-clone-submodules.sh b/t/t5614-clone-submodules.sh
>> new file mode 100755
>> index 0000000..62044c5
>> --- /dev/null
>> +++ b/t/t5614-clone-submodules.sh
>> @@ -0,0 +1,85 @@
>> +#!/bin/sh
>> +
>> +test_description='Test shallow cloning of repos with submodules'
>> +
>> +. ./test-lib.sh
>> +
>> +pwd=$(pwd)
>> +
>> +test_expect_success 'setup' '
>> +     git checkout -b master &&
>> +     test_commit commit1 &&
>> +     test_commit commit2 &&
>> +     mkdir sub &&
>> +     (
>> +             cd sub &&
>> +             git init &&
>> +             test_commit subcommit1 &&
>> +             test_commit subcommit2 &&
>> +             test_commit subcommit3
>> +     ) &&
>> +     git submodule add "file://$pwd/sub" sub &&
>> +     git commit -m "add submodule"
>> +'
>> +
>> +test_expect_success 'nonshallow clone implies nonshallow submodule' '
>> +     test_when_finished "rm -rf super_clone" &&
>> +     git clone --recurse-submodules "file://$pwd/." super_clone &&
>
> All of these "$path/." made me wonder one thing.  I know these URLs
> that ends with slash-dot ought to work, but shouldn't they work
> without them, too?  The "consistency" in this test that ends
> anything that would have ended with "$pwd" with "$pwd/." somewhat
> bothered me.
>

Another case of me not thinking it through. There used to be just '.' in the former series with the --no-local option. And to make it a file url I just prefixed that dot without thinking if the dot is still needed.

In case another reroll is needed, I'll fix that up, too.

Thanks, Stefan

Previous: Junio C Hamano
Message 3 of 3 in “[PATCHv2] clone: add `--shallow-submodules` flag”
  1. Stefan BellerApr 26, 2016
  2. Junio C HamanoApr 26, 2016
  3. Stefan BellerApr 26, 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.