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

Re: [RFC/PATCH 2/4] Submodules: Add the lib-submodule-update.sh test library

From
Jens Lehmann <jens.lehmann@web.de>
Date
Apr 18, 2014, 12:31 UTC
Message-ID
<53511B09.1010700@web.de>
In-Reply-To
<20140417215531.GY21805@odin.tremily.us>
Am 17.04.2014 23:55, schrieb W. Trevor King:
Show 25 quoted lines
> On Thu, Apr 17, 2014 at 11:08:06PM +0200, Jens Lehmann wrote:
>> Am 17.04.2014 18:41, schrieb W. Trevor King:
>>> On Tue, Mar 25, 2014 at 06:05:05PM +0100, Jens Lehmann wrote:
>>>> *) When a submodule is replaced with a tracked file of the same name
>>>>    the submodule work tree including any local modifications (and
>>>>    even the whole history if it uses a .git directory instead of a
>>>>    gitfile!) is simply removed.
>>>> …
>>>> I think the first bug really needs to be fixed, as that behavior is
>>>> extremely nasty. We should always protect work tree modifications
>>>> (unless forced) and *never* remove a .git directory (even when
>>>> forced).
>>>
>>> I think this should be covered by the usual “don't allow checkouts
>>> from dirty workdirs unless the dirty-ing changes are easily applied to
>>> the target tree”.
>>
>> Nope, the target tree will be removed completely and everything in
>> it is silently nuked. It should be allowed with '-f', but only if
>> the submodule contains a gitfile, and never if it contains a .git
>> directory (which is just what we do for rm too).
> 
> I think it's not covered *now* because of a flaw in our “are dirty-ing
> changes easily applied to the target tree” detection logic, and the
> solution should involve updating that logic to hit on this case.
Yup.
Show 11 quoted lines
>> b) recursive checkout is the place to consistently care about
>> submodule modifications (the submodule script doesn't do that and it
>> is impossible to change that without causing trouble to a lot of
>> users.
> 
> I agree that the submodule script is not the place for this, and the
> core checkout code is.  I'd like checkouts to always be recursive, and
> see --[no-]recurse-submodules as a finger-breaking stop-gap until we
> can complete that transition for checkout, bisect, merge, reset, and
> other work-tree altering commands.  I think this is one reason why
> some folks prefer the stiffer joints you get from a subtree approach.
We are definitely in the same boat here :-)
Previous: W. Trevor KingNext: Jens Lehmann
Message 15 of 17 in “Add submodule test harness”
  1. 0/4 Add submodule test harnessJens Lehmann, Mar 25, 2014
  2. 1/4 test-lib: add test_dir_is_empty()Jens Lehmann, Mar 25, 2014
  3. Junio C HamanoMar 25, 2014
  4. David KastrupMar 25, 2014
  5. Jens LehmannMar 26, 2014
  6. Michael HaggertyMar 26, 2014
  7. Jens LehmannMar 26, 2014
  8. 2/4 Submodules: Add the lib-submodule-update.sh test libraryJens Lehmann, Mar 25, 2014
  9. W. Trevor KingApr 17, 2014
  10. Junio C HamanoApr 17, 2014
  11. Jens LehmannApr 17, 2014
  12. Heiko VoigtApr 18, 2014
  13. Jens LehmannApr 17, 2014
  14. W. Trevor KingApr 17, 2014
  15. Jens LehmannApr 18, 2014
  16. 3/4 checkout: call the new submodule update test frameworkJens Lehmann, Mar 25, 2014
  17. 4/4 apply: add t4137 for submodule updatesJens Lehmann, Mar 25, 2014

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.