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:00 UTC
Message-ID
<CAGZ79kar0F7x5U2yZ30ZnWZ9b=EJA=1nT8rxTMRVJPggyFS_XA@mail.gmail.com>
In-Reply-To
<xmqqpolcd73b.fsf@gitster.mtv.corp.google.com>
On Wed, Nov 30, 2016 at 12:51 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 21 quoted lines
> Duy Nguyen <pclouds@gmail.com> writes:
>
>> On Wed, Nov 23, 2016 at 2:22 AM, Stefan Beller <sbeller@google.com> wrote:
>>> +/*
>>> + * Migrate the given submodule (and all its submodules recursively) from
>>> + * having its git directory within the working tree to the git dir nested
>>> + * in its superprojects git dir under modules/.
>>> + */
>>> +void migrate_submodule_gitdir(const char *prefix, const char *path,
>>> +                             int recursive)
>>
>> Submodules and worktrees seem to have many things in common. The first
>> one is this. "git worktree move" on a worktree that contains
>> submodules .git also benefits from something like this [1]. I suggest
>> you move this function to some neutral place and maybe rename it to
>> relocate_gitdir() or something.
>
> Yeah, good suggestion (including name; first round used "intern" I
> had trouble with, then "embed" which was OK-ish, but probably
> "relocate" is better choice.  If anything, what Stefan's series adds
> is a command to un-embed embedded one).

Heh, good counter perspective. I thought about embedding it "into the superprojects git directory" whereas your un-embed sounds like you'd assume embedding is targetd towards the working dir.

relocate as a fancy name for move sounds like it expects 2 arguments (source and destination), but maybe we could go with:

    git relocate-git-dir (--into-workingtree|--into-gitdir) \
      [--recurse-submodules] \
      [--only-fix-gitfile-links-and-core-setting-as-I-moved-it-myself-already] \
      [--dryrun] [--verbose] [--unsafe-move]

No need to have a pathspec here IMHO. Later it could have another flag to specify the "main" worktree or such as well.

Previous: Junio C HamanoNext: Junio C Hamano
Message 11 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.