threads / discuss / 51850

GIT_OBJECT_DIRECTORY ignored when cloning submodules

Subject: GIT_OBJECT_DIRECTORY ignored when cloning submodules

## tl;dr

2 messages between Sep 14, 2019 and Sep 16, 2019.

replies: 1people: 2as markdown or json

Robert Schmidt-Cisternas· Sep 14, 2019, 16:07 UTC · lore
Hi,

In the pursuit of optimizing meta-repo workflows, I wanted to use GIT_OBJECT_DIRECTORY to specify a single objects directory used by all repos and submodules on a workstation.

The idea being that many metarepos will contain similar sets of submodules, and objects can be reused, thus potentially saving massive amounts of disk space and network traffic.

However, when cloning a repo with submodules, the variable is cleared when the submodules are cloned recursively.

Is this a bug, or intentional?

Thanks, Robert Schmidt

Junio C Hamano· Sep 16, 2019, 18:03 UTC · re: Robert Schmidt-Cisternas · lore

Re: GIT_OBJECT_DIRECTORY ignored when cloning submodules

Robert Schmidt-Cisternas <robert@schmidt-cisternas.net> writes:
> However, when cloning a repo with submodules, the variable is cleared

GIT_OBJECT_DIRECTORY applies to the source object store, not the target object store---clearing is very much intentional, I think.

An operation like clone, fetch and push can involve two object stores (iow, you can do them between two repositories on the same machine using local transport), and allowing both sides to use the same GIT_OBJECT_DIRECTORY would probably not make much sense.

← back to recent threads