Re: Saving space/network on common repos
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 17, 2014, 22:32 UTC
- Message-ID
- <20141217223215.GO29365@google.com>
- In-Reply-To
- <CAGXKyzEYhR69w1=4q-xtBagVBwOPqNA9C=AD0bAorB+5eRtVRg@mail.gmail.com>
(+cc: Duy who wrote the recent 'checkout --to' patch series) Hi Craig,
Craig Silverstein wrote:
Show 7 quoted lines
> By design, our Jenkins machine has several different > directories that each hold a copy of the same git repository. (For > instance, Jenkins may be running tests on our repo at several > different commits at the same time.) When Jenkins decides to run a > test -- I'm simplifying a bit -- it will pick one of the copies of the > repo, do a 'git fetch origin && git checkout <some commit>' and the > run the tests.
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.
There's a patch series to move that functionality into core git through an option "git checkout --to=<directory>" that creates a new workdir for an existing repository that is currently in the pu ("proposed updates") branch.
[...]
Show 5 quoted lines
> An added complication is submodules. We have a submodule that is as > big and slow to fetch as our main repository. > > 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. Later calls to "git submodule update" will do the right thing.)
Thanks for a useful example, Jonathan