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

Question about recurse-submodules

From
ASAnupam Singh <anupamsingh610@gmail.com>
Date
Nov 28, 2019, 12:03 UTC
Message-ID
<CAJz+0yYpv55j0gmMDO3MfbJXzrfT5BJ7vKk9hzr_u3CLtM+WLw@mail.gmail.com>
Hi,
I have been facing an issue when recursing over submodules during git clone.

TLDR : Create a project with multiple submodules with different access rights for different users. When a user clones the main project she should get only the submodules she is allowed to access.

Consider following example :
I want to make a repo named MainProject with submodules Sub1 and Sub2 as shown
MainProject (Accessible)
      |-> Sub1 (Accessible)
      |-> Sub2 (Inaccesible)
      |-> README.md

Where I have rights to MainProject and Sub1 but not Sub2. What I want is when I clone MainProject with --recurse-submodules it recurse through all the submodules and try to clone it. If it fails it should move to next submodule, but what happens is that it fails and exits.

Also I know that I can pass the submodules' pathspec that I want to recurse after the commit clone: teach --recurse-submodules to optionally take a pathspec to https://github.com/git/git.git. But I dont want to specify this because there may be multiple submodules and clone command can get lengthy. Also the user will have to know what folder she has rights to.

I am kind of stuck and need assisstance. Is there another way to achieve this? Any assistance would be appreciated.

PS : I'm a fan of GIT :)

Regards, Anupam

Message 1 of 1 in “Question about recurse-submodules”
  1. Anupam SinghNov 28, 2019

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.