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

Re: Saving space/network on common repos

From
CSCraig Silverstein <csilvers@khanacademy.org>
Date
Dec 17, 2014, 23:57 UTC
Message-ID
<CAGXKyzEqTik3p=A8NZJ6kUscFjw_Dh1mBPT-ciwq9L8kNKDDig@mail.gmail.com>
In-Reply-To
<20141217223215.GO29365@google.com>
On Wed, Dec 17, 2014 at 2:32 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> You might find 'git new-workdir' from contrib/workdir to be helpful.
> It lets you attach multiple working copies to a single set of objects
> and refs.

Thanks! That does indeed sound promising -- like a more principled version of my GIT_OBJECT_DIRECTORY suggestion.

Show 6 quoted lines
>> Question 4) Is there a practical way to set up submodules so they can
>> use the same object-sharing framework that the main repo does?
>
> It's possible to do, but we haven't written a nice UI for it yet.
> (In other words, you can do this by cloning with --no-recurse-submodules
> and manually creating the submodule workdir in the appropriate place.
Hmm, let me see if I understand you right -- you're suggesting that
when cloning my reference repo, I do
    git clone --no-recurse-submodules <my repo>
    for (path, url) in `parse-.gitmodules`: git clone url path
# this is psuedocode, obviously :-)
and then when I want to create a new workdir, I do something like:
    cd reference_repo
    git new-workdir /var/workspace1
    for (path, url) in `parse-.gitmodules`: cd path && git new-workdir
/var/workspace1/path

? Basically, I'm going back to the old git way of having each submodule have its own .git directory, rather than having it have a .git file with a 'gitdir' entry. Am I understanding this right?

Also, it seems to me there's the possibility, with git-newdir, that if several of the workspaces try to fetch at the same time they could step on each others' toes. Is that a problem? I know there's a push lock but I don't believe there's a fetch lock, and I could imagine git getting unhappy if two fetches happened in the same repo at the same time.

craig
Previous: Jonathan NiederNext: Jonathan Nieder
Message 4 of 9 in “Saving space/network on common repos”
  1. Craig SilversteinDec 17, 2014
  2. Stefan BellerDec 17, 2014
  3. Jonathan NiederDec 17, 2014
  4. Craig SilversteinDec 17, 2014
  5. Jonathan NiederDec 18, 2014
  6. Craig SilversteinDec 23, 2014
  7. Jonathan NiederDec 23, 2014
  8. Jonathan NiederDec 23, 2014
  9. Craig SilversteinDec 23, 2014

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.