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

Re: Moving (renaming) submodules, recipe/script

From
W. Trevor King <wking@tremily.us>
Date
Jan 8, 2013, 17:48 UTC
Message-ID
<20130108174857.GF4662@odin.tremily.us>
In-Reply-To
<50EC536D.8050606@web.de>
On Tue, Jan 08, 2013 at 06:12:13PM +0100, Jens Lehmann wrote:
Show 7 quoted lines
> Am 08.01.2013 15:32, schrieb W. Trevor King:
> >  The Git directory for the
> > submodule stays in .git/modules/submod-1/ (good), but the worktree in
> > .git/modules/submod-1/config still points to ../../../submod-1 (bad).
> 
> You'll not only have to update the gitfile but also the core.worktree
> setting in the repo. Sorry I missed that when you posted your script.

My git-submodule-mv.sh script does update core.worktree. The problem is that `git checkout`, `git merge`, etc. do not.

Show 13 quoted lines
> > This means that submodule moves are possible, but anyone trying to
> > share them between several repositories (or trying to rebase across
> > the move within their own repository) is in for a world of suffering
> > ;).  I'm not sure how this should be addressed, but I didn't see
> > anything handling it in Jens' new series.
> 
> If you adjust core.worktree properly you'll just have the old
> submodule work tree lying around (just like you do after you rm'd
> it) and everything apart from that should just work.
> 
> As I mentioned that will be fixed by recursive submodule checkout.
> I'll see if I can polish my preliminary branch so that interested
> people can play around with it if anyone is interested.

Sounds like a fix will be in here. I'll definitely help put the branch through its paces ;).

Trevor
-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
Previous: Jens Lehmann
Message 11 of 11 in “Moving (renaming) submodules, recipe/script”
  1. W. Trevor KingJan 7, 2013
  2. Jonathan NiederJan 7, 2013
  3. Jens LehmannJan 7, 2013
  4. Junio C HamanoJan 7, 2013
  5. Jens LehmannJan 7, 2013
  6. Junio C HamanoJan 7, 2013
  7. W. Trevor KingJan 7, 2013
  8. W. Trevor KingJan 8, 2013
  9. W. Trevor KingJan 8, 2013
  10. Jens LehmannJan 8, 2013
  11. W. Trevor KingJan 8, 2013

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.