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

Re: submodule update --force

From
SZStefan Zager <szager@google.com>
Date
May 10, 2012, 07:20 UTC
Message-ID
<CAHOQ7J_6+sfU6egjvVSPj-FAS6zjSUT=a057=kz_wYbogHLMMA@mail.gmail.com>
In-Reply-To
<7vk40kpnia.fsf@alter.siamese.dyndns.org>
On Wed, May 9, 2012 at 11:18 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> If we follow that line of thought, it may make more sense not to implement
> your feature like the above patch, but instead make it so
>
>        if the user told us never to recurse
>        then
>                nothing
>        elif the user told us to always recurse ||
>             subsha1 != sha1
>        then
>                do the "recurse" thing
>        fi
>
> so that you can still force it recurse into the submodule, even when you
> do not necessarily want the "force checkout" thing to happen to clobber
> the working tree.

I'm a bit confused by your use of the term recursion here. It sounds like you consider any operation run on a submodule to be a form of recursion, which is not the way I think about it. To my mind, any `git submodule` command should *always* run on the first level of submodules. If you're going to specify --no-recurse, then why are you running `git submodule` at all? I think 'recursion' only applies to moving beyond the first level of submodules.

I think your solution would work for our project, because we only use one level of submodules. But IMO the functionality, as you have written it, is less generally useful.

Stefan
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 12 in “submodule update --force”
  1. Stefan ZagerMay 9, 2012
  2. Junio C HamanoMay 10, 2012
  3. Junio C HamanoMay 10, 2012
  4. Stefan ZagerMay 10, 2012
  5. Junio C HamanoMay 10, 2012
  6. Heiko VoigtMay 10, 2012
  7. Phil HordMay 11, 2012
  8. Heiko VoigtMay 14, 2012
  9. Stefan ZagerMay 14, 2012
  10. Heiko VoigtMay 14, 2012
  11. Stefan ZagerMay 14, 2012
  12. Heiko VoigtMay 14, 2012

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.