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

Re: [PATCH 1/2] submodule add: extend force flag to add existing repos

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 6, 2016, 20:11 UTC
Message-ID
<xmqqshs9i6fr.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20161006193725.31553-2-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 12 quoted lines
> Currently the force flag in `git submodule add` takes care of possibly
> ignored files or when a name collision occurs.
>
> However there is another situation where submodule add comes in handy:
> When you already have a gitlink recorded, but no configuration was
> done (i.e. no .gitmodules file nor any entry in .git/config) and you
> want to generate these config entries. For this situation allow
> `git submodule add` to proceed if there is already a submodule at the
> given path in the index.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
Yup, the goal makes perfect sense.  

I vaguely recall discussing this exact issue of "git submodule add" that refuses to add a path that already is a gitlink (via "git add" that has previously been run) elsewhere on this list some time ago.

Previous: Stefan BellerNext: Heiko Voigt
Message 3 of 10 in “submodule pushes be extra careful”
  1. 0/2 submodule pushes be extra carefulStefan Beller, Oct 6, 2016
  2. 1/2 submodule add: extend force flag to add existing reposStefan Beller, Oct 6, 2016
  3. Junio C HamanoOct 6, 2016
  4. Heiko VoigtOct 7, 2016
  5. Stefan BellerOct 7, 2016
  6. Heiko VoigtOct 11, 2016
  7. 2/2 push: change submodule default to check when submodules existStefan Beller, Oct 6, 2016
  8. Junio C HamanoOct 6, 2016
  9. Stefan BellerOct 6, 2016
  10. [PATCHv5] push: change submodule default to check when submodules existStefan Beller, Oct 6, 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.