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

git-add creates broken submodules

From
strk <strk@keybit.net>
Date
Aug 30, 2010, 09:09 UTC
Message-ID
<20100830090945.GB13729@keybit.net>

Hi there, with help of doener (#git on freenode) I found the root cause of a misconfigured git repository being in the way 'git add <path>' behaves when <path> contains a .git repository.

Example:
$ (mkdir foo; cd foo; git init; git commit --allow-empty -m ini); \
  git add foo
$ git submodule status
No submodule mapping found in .gitmodules for path 'foo'

Such commit ended up in our centralized repository so that all clones now have this 'submodule' w/out entries in .gitmodules and .git/config.

Should 'git-add' simply consider any .git as a normal entry instead ? (that's what I'd expect) Or, if not, should it warn about the presence of a .git directory and refuse to continue suggesting 'git submodule add' instead.

NOTE: this happens with git version 1.6.0.2
--strk; 
  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
Message 1 of 1 in “git-add creates broken submodules”
  1. strkAug 30, 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.