On Wed, Nov 30, 2016 at 1:39 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > Stefan Beller <sbeller@xxxxxxxxxx> writes: > >> git relocate-git-dir (--into-workingtree|--into-gitdir) \ > > I am not sure if you meant this as a submodule-specific subcommand > or more general helper. "into-workingtree" suggests to me that it > is submodule specific, so I'll base my response on that assumption. > > Would there ever be a situation where you already have submodule > repositories in the right place (according to the more modern > practice, to keep them in .git/modules/ of superproject) and want to > move them to embed them in worktrees of submodules? I do not think > of any. "Hi, I made a mistake by using submodules. I don't want to use them any more, I rather want to: A) make it a separate git repo again and I'll keep them in sync myself B) ... " "I abuse submodules for what git-LFS was designed for, and the submodule is on a different mount point, please keep the git directory also at that mount point". Not sure I agree these problems and the proposed solutions are beautiful, but that is what people may think of as a fast hack? > > If there is no such situation, I do not think we want a verb that is > direction-neutral (e.g. "move" or "relocate") with two options. > Rather we would want "git submodule unembed-git-dir" or something > like that. So when we want to have a generic function in C ("relocate_gitdir") for both worktree and submodules, the recursive flag is not supposed to invoke a submodule specific helper, but a generic helper. Alternatively we make the function not as generic and claim the recursive part is submodule specific and we can happily call "git submodule [un]embed-git-dir" recursively.