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

Re: [BUG] `git reset --hard` fails with `update = none` submodules

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jun 17, 2021, 23:52 UTC
Message-ID
<YMvgRjwyrwyLz4SC@camp.crustytoothpaste.net>
In-Reply-To
<3b53846d-7611-521a-274c-473e00266529@gmail.com>
On 2021-06-16 at 13:20:44, Philippe Blain wrote:
Show 20 quoted lines
> Hi all,
> 
> Le 2021-06-15 à 23:10, Junio C Hamano a écrit :
> > "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> > 
> > > My gut tells me that we should probably mark submodules with update=none
> > > set on a clone as inactive.  Of course, this is a tricky area that I'm
> > > not super familiar with, so opinions or thoughts are welcome.
> > > 
> > > If folks think this is a good way forward, I'll look into writing a
> > > patch, probably tomorrow evening since it's starting to get late here.
> 
> This is probably a good fix. 'git clone --recurse-submodules' is really
> too eager to write the 'submodule.active=.' config but it should be more careful;
> the above is an example and [1] is another one.
> 
> I think it is a good way forward that having 'submodule.$name.update=none' in
> '.gitmodules' means that 'git clone' would write 'submodule.$name.active=false'
> to the local config. This way it would still be the case that 'submodule.$name.update'
> itself only ever applies to 'git submodule update', which is what is documented [2].

I have a patch along this line and am looking into some test failures, so it's not that I've forgotten about it, but that it is, as usual, not as trivial as I'd hoped. It may take me until the weekend to come up with something nice.

Our problem seems to be that once we mark it as inactive, we never end up initializing the repository even if something like --checkout is passed (at least in the tests), so I'm trying to come up with an elegant way to deal with that.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Philippe BlainNext: brian m. carlson
Message 11 of 18 in “[BUG] `git reset --hard` fails with `update = none` submodules”
  1. Rose KunkelJun 16, 2021
  2. brian m. carlsonJun 16, 2021
  3. Rose KunkelJun 16, 2021
  4. Rose KunkelJun 16, 2021
  5. Rose KunkelJun 16, 2021
  6. brian m. carlsonJun 16, 2021
  7. Rose KunkelJun 16, 2021
  8. Rose KunkelJun 16, 2021
  9. Junio C HamanoJun 16, 2021
  10. Philippe BlainJun 16, 2021
  11. brian m. carlsonJun 17, 2021
  12. submodule: mark submodules with update=none as inactivebrian m. carlson, Jun 19, 2021
  13. Philippe BlainJun 22, 2021
  14. brian m. carlsonJun 25, 2021
  15. Philippe BlainJun 26, 2021
  16. submodule: mark submodules with update=none as inactivebrian m. carlson, Jul 1, 2021
  17. Philippe BlainJul 9, 2021
  18. brian m. carlsonJul 11, 2021

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.