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

[PATCH/RFC 0/3] Teach mv to move submodules

From
Jens Lehmann <jens.lehmann@web.de>
Date
Apr 3, 2013, 19:54 UTC
Message-ID
<515C88FE.9020203@web.de>

This is the last topic I intend to finish before preparing the recursive submodule update. The other prerequisites for that next step are Heiko's "allow more sources for config values" and "fetch moved submodules on-demand" topics, which are necessary to populate submodules that were not present in the currently checked out commit and to have all commits of moved or currently not present submodules fetched for later checkout respectively. But these are other threads ...

Let's enable users to move submodules (just as easy as they can already remove them with current Git with "git rm") by using a plain "git mv". While using "git submodule update" on a moved submodule cloned by a coworker will still leave the submodule's work tree lying around at the old path, that will be fixed by the recursive submodule update (and is not different from what Git currently does with removed submodules). Replacing a directory containing files tracked by Git or vice versa is still not possible, another issue to be fixed by the recursive submodule update. I tried to CC all parties which showed interest in this topic, hopefully I didn't forget anyone.

Jens Lehmann (3):
  Teach mv to move submodules together with their work trees
  Teach mv to move submodules using a gitfile
  Teach mv to update the path entry in .gitmodules for moved submodules
 builtin/mv.c  | 126 ++++++++++++++++++++++++++++++++++------------------------
 submodule.c   | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 submodule.h   |   3 ++
 t/t7001-mv.sh |  94 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 297 insertions(+), 52 deletions(-)
-- 
1.8.2.377.g1bdb7d0
Next: Jens Lehmann
Message 1 of 14 in “Teach mv to move submodules”
  1. 0/3 Teach mv to move submodulesJens Lehmann, Apr 3, 2013
  2. 1/3 Teach mv to move submodules together with their work treesJens Lehmann, Apr 3, 2013
  3. Ramkumar RamachandraApr 11, 2013
  4. Junio C HamanoApr 11, 2013
  5. Junio C HamanoApr 11, 2013
  6. 2/3 Teach mv to move submodules using a gitfileJens Lehmann, Apr 3, 2013
  7. Junio C HamanoApr 9, 2013
  8. Jens LehmannApr 10, 2013
  9. 2/3 Teach mv to move submodules using a gitfileJens Lehmann, Apr 10, 2013
  10. Ramkumar RamachandraApr 11, 2013
  11. Junio C HamanoApr 11, 2013
  12. 3/3 Teach mv to update the path entry in .gitmodules for moved submodulesJens Lehmann, Apr 3, 2013
  13. Ramkumar RamachandraApr 11, 2013
  14. Junio C HamanoApr 11, 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.