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

Re: [PATCHv2 4/4] submodule: add embed-git-dir function

From
Stefan Beller <sbeller@google.com>
Date
Nov 30, 2016, 21:56 UTC
Message-ID
<CAGZ79kZSAJauwBwrxf+QAhQgyu4ACn+8LrwjpFGVaUQfSzHEAg@mail.gmail.com>
In-Reply-To
<xmqqfum8d4w3.fsf@gitster.mtv.corp.google.com>
On Wed, Nov 30, 2016 at 1:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> Stefan Beller <sbeller@google.com> 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?

Show 5 quoted lines
>
> 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.

Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 14 in “[PATCHv2 0/4] `submodule embedgitdirs` [was: Introduce `submodule interngitdirs`]”
  1. Stefan BellerNov 22, 2016
  2. 1/4 submodule: use absolute path for computing relative path connectingStefan Beller, Nov 22, 2016
  3. 3/4 test-lib-functions.sh: teach test_commit -C <dir>Stefan Beller, Nov 22, 2016
  4. 2/4 submodule helper: support super prefixStefan Beller, Nov 22, 2016
  5. 4/4 submodule: add embed-git-dir functionStefan Beller, Nov 22, 2016
  6. SQUASHStefan Beller, Nov 22, 2016
  7. Duy NguyenNov 30, 2016
  8. Stefan BellerNov 30, 2016
  9. Stefan BellerNov 30, 2016
  10. Junio C HamanoNov 30, 2016
  11. Stefan BellerNov 30, 2016
  12. Junio C HamanoNov 30, 2016
  13. Stefan BellerNov 30, 2016
  14. Junio C HamanoNov 30, 2016

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.