git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andry <andry@inbox.ru>
To: git@vger.kernel.org
Subject: nested submodules detection w/o .gitmodules file
Date: Sun, 22 Jan 2023 23:34:03 +0300	[thread overview]
Message-ID: <1716310675.20230122233403@inbox.ru> (raw)

Hello Git,

I have a pretty long investigation has been started from usage 3dparty projects related directly or indirectly to the git submodules:

`svn externals replacement` : https://github.com/chronoxor/gil/issues/6
`svn complete replacement for externals` : https://github.com/dirk-thomas/vcstool/issues/243

And stumbled on this discussion:

`nested submodules detection w/o .gitmodules file` : https://github.com/gitextensions/gitextensions/discussions/10644 (https://github.com/gitextensions/gitextensions/issues/10642)

The main question here is that, could the git have has submodules without `.submodules` file?

If no, then all side projects which utilizes it's own input file for the externals may subsequentially fail:

https://github.com/chronoxor/gil
https://github.com/dirk-thomas/vcstool
https://github.com/ingydotnet/git-subrepo

If yes, then other projects which does rely on the `.submodules` would have not actual or even invalid state:

https://github.com/gitextensions/gitextensions

Or even the github itself: 

`Zip archive to include submodule` : https://github.com/dear-github/dear-github/issues/214

(`[PATCH] archive: add –recurse-submodules to git-archive command` : https://git.github.io/rev_news/2022/11/30/edition-93/, https://lore.kernel.org/git/pull.1359.git.git.1665597148042.gitgitgadget@gmail.com/)

Mine point here is that:

Git database is a primary storage. The `.gitmodules` file is not a primary storage, so can be in not an actual or desync state with the database.
And any application or a 3dparty project must read the database directly.

But another problem here is that the git still does not have a stable API for that.
For example, a submodule can be declared directly from the `.git/config` file in a working copy: 

https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-init--ltpathgt82308203
https://git-scm.com/docs/gitsubmodules#_active_submodules

So, who is right and what is wrong here?


             reply	other threads:[~2023-01-22 20:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-22 20:34 Andry [this message]
2023-01-23 20:12 ` nested submodules detection w/o .gitmodules file Emily Shaffer
2023-01-24 14:54   ` Andry
2023-02-03  1:04 ` Andry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1716310675.20230122233403@inbox.ru \
    --to=andry@inbox.ru \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).