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

Re: Submodule, subtree, or something else?

From
JRJānis Rukšāns <janis.ruksans@gmail.com>
Date
Aug 24, 2015, 17:53 UTC
Message-ID
<1440438795.32140.98.camel@gmail.com>
In-Reply-To
<CAGZ79kY+HLzd4esdy+i82Eh5Vhc1NEDDfinD2iiBMvV41GSCiw@mail.gmail.com>
On P , 2015-08-24 at 09:51 -0700, Stefan Beller wrote:
Show 5 quoted lines
> IIUC, the second command will lookup the submodules in $(pwd), but if
> they are not there they are skipped, so all of the existing submodules
> are cloned.
> Why do you need more submodules in the tmp clone than in
> $(pwd)/projectA would be my next question. But I see your point now.

The $(pwd) was just an example to illustrate my point. The actual use case is that I would be hacking on something at work, notice that it is already late and I have to catch the last bus home, yet I don't want to postpone whatever I was working on until the next day. So I would do git commit -a -m "[WIP] Stuff, finish at home" to save my work so far, go home, and clone / fetch it over ssh.

Another important factor is that a lot of our code can be meaningfully tested only on the actual hardware, and is built in a VM. Quite often getting things right involve many iterations of hack hack hack, git commit --amend, fetch && reset --hard in the VM, build, test, repeat. Being able to clone / fetch directly from the copy I am working on makes it a lot easier.

As I wrote in the other e-mail, I managed to achieve the desired result by using ./<submodule> (without .git suffix) as the submodule URL, and creating a file named <submodule> in the bare repo with 'gitdir: ../<submodule.git>' as it's contents, but I'm not sure whether it is a good idea or not.

Jānis
Previous: Stefan BellerNext: Jānis Rukšāns
Message 5 of 6 in “Submodule, subtree, or something else?”
  1. Jānis RukšānsAug 21, 2015
  2. Stefan BellerAug 22, 2015
  3. Jānis RukšānsAug 23, 2015
  4. Stefan BellerAug 24, 2015
  5. Jānis RukšānsAug 24, 2015
  6. Jānis RukšānsAug 24, 2015

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.