From: Junio C Hamano Date: Thu, 11 Apr 2013 16:59:45 GMT Subject: Re: [PATCH/RFC 3/3] Teach mv to update the path entry in .gitmodules for moved submodules Message-ID: <7v61ztj94u.fsf@alter.siamese.dyndns.org> In-Reply-To: <515C89BA.9020806@web.de> Jens Lehmann writes: > Currently using "git mv" on a submodule moves the submodule's work tree in > that of the superproject. But the submodule's path setting in .gitmodules > is left untouched, which is now inconsistent with the work tree and makes > git commands that rely on the proper path -> name mapping (like status and > diff) behave strangely. > > Let "git mv" help here by not only moving the submodule's work tree but > also updating the "submodule..path" setting from the > .gitmodules file and stage both. This doesn't happen when no .gitmodules > file is found and only issues a warning when it doesn't have a section for > this submodule. Should it happen when the user has other changes to .gitmodules that hasn't been updated to the index? As this is done in the same final "per-path" loop as adjusting the gitfile links, the worry I expressed in an earlier message about "git mv a/ b/" when "a/x" is a submodule turns out to be unfounded, which is good ;-)