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

Re: [PATCH] submodule recursion in git-archive

From
Nick Townsend <nick.townsend@mac.com>
Date
Nov 27, 2013, 03:33 UTC
Message-ID
<8C8E104C-D88D-47C9-A796-6634BABFAB3E@mac.com>
In-Reply-To
<20131126223858.GA4774@sandbox-ub>
On 26 Nov 2013, at 14:38, Heiko Voigt <hvoigt@hvoigt.net> wrote:
Show 28 quoted lines
> Hi,
> 
> I like where this is going.
> 
> On Tue, Nov 26, 2013 at 04:17:43PM +0100, René Scharfe wrote:
>> Am 26.11.2013 01:04, schrieb Nick Townsend:
>>> +		strbuf_addstr(&dotgit, work_tree);
>>> +		strbuf_addch(&dotgit, '/');
>>> +		if (args->treepath) {
>>> +			  strbuf_addstr(&dotgit, args->treepath);
>>> +			  strbuf_addch(&dotgit, '/');
>>> +		}
>>> +		strbuf_add(&dotgit, path_without_prefix,strlen(path_without_prefix)-1);
>>> +		if (add_submodule_odb(dotgit.buf))
>>> +			  die("Can't add submodule: %s", dotgit.buf);
>> 
>> Hmm, I wonder if we can traverse the tree and load all submodule object
>> databases before traversing it again to actually write file contents.
>> That would spare the user from getting half of an archive together with
>> that error message.
> 
> I am not sure whether we should die here. What about submodules that
> have not been initialized and or cloned? I think that is a quite regular
> use case for example for libraries that not everyone needs or big media
> submodules which only the design team uses. How about skipping them (maybe
> issuing a warning) by returning 0 here and proceeding?
> 
> Cheers Heiko

I agree that issuing a warning and continuing is best. If the submodule hasn’t been setup then we should respect that and keep the current behaviour (just archive the directory entry). There is some further debate to be had about the extent to which this should work with un-initialized submodules which I’ll discuss in other replies.

Thanks Nick

Previous: Heiko Voigt
Message 14 of 14 in “submodule recursion in git-archive”
  1. submodule recursion in git-archiveNick Townsend, Nov 26, 2013
  2. René ScharfeNov 26, 2013
  3. Jens LehmannNov 26, 2013
  4. Junio C HamanoNov 26, 2013
  5. René ScharfeNov 27, 2013
  6. Nick TownsendNov 27, 2013
  7. Junio C HamanoNov 27, 2013
  8. Nick TownsendNov 27, 2013
  9. Junio C HamanoNov 27, 2013
  10. Heiko VoigtNov 29, 2013
  11. Nick TownsendDec 3, 2013
  12. Fwd: [PATCH] submodule recursion in git-archiveNick Townsend, Dec 3, 2013
  13. Heiko VoigtNov 26, 2013
  14. Nick TownsendNov 27, 2013

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.