From: Stefan Beller <sbeller@google.com>
To: David Turner <David.Turner@twosigma.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Uninitialized submodules as symlinks
Date: Fri, 7 Oct 2016 11:56:03 -0700 [thread overview]
Message-ID: <CAGZ79ka1rJCks5np9Q__HAHYFDrdGDFLtquhb3fY_iL8q9DEkw@mail.gmail.com> (raw)
In-Reply-To: <fd5bcf57f92944c0b7f6f2f8342c342c@exmbdft7.ad.twosigma.com>
On Fri, Oct 7, 2016 at 11:17 AM, David Turner <David.Turner@twosigma.com> wrote:
> Presently, uninitialized submodules are materialized in the working tree as empty directories.
Right, there has to be something, to hint at the user that creating a
file with that
path is probably not what they want.
> We would like to consider having them be symlinks. Specifically, we'd like them to be symlinks into a FUSE filesystem which retrieves files on demand.
>
> We've actually already got a FUSE filesystem written, but we use a different (semi-manual) means to connect it to the initialized submodules.
So you currently do a
git submodule init <pathspec>
custom-submodule make-symlink <pathspec>
?
> We hope to release this FUSE filesystem as free software at some point soon, but we do not yet have a fixed schedule for doing so. Having to run a command to create the symlink-based "union" filesystem is not optimal (since we have to re-run it every time we initialize or deinitialize a submodule).
>
> But if the uninitialized submodules could be symlinks into the FUSE filesystem, we wouldn't have this problem. This solution isn't necessarily FUSE-specific -- perhaps someone would want copies of the same submodule in multiple repos, and would want to save disk space by having all copies point to the same place. So the symlinks would be configured by a per-submodule config variable.
I'd imagine that you want both a per-submodule config variable as
well as a global variable that is a default for all submodules?
git config submodule.trySymlinkDefault /mounted/fuse/
# any (new) submodule tries to be linked to /mounted/fuse/<path>
git config submodule.<name>.symlinked ~/my/private/symlinked
# The <name> submodule goes into another path.
As you propose the FUSE filesystem fetches files on demand, you
probably want to disable things that scan the whole submodule,
e.g. look at submodule.<name>.ignore to suppress status looking
at all files.
When looking through the options, you could add the value "symlink" to
submodule.<name>.update, which then respects the
submodule.trySymlinkDefault if present, such that
git clone --recurse-submodules ...
works and sets up the FUSE thing correctly.
How does the FUSE system handle different versions, i.e.
`git submodule update` to checkout another version of the submodule?
(btw, I plan on working on integrating submodules to "git checkout",
so "submodule update" would not need to be run there, but we'd hook
it into checkout instead)
>
> Naturally, this would require some changes to code that examines the working tree -- git status, git diff, etc. They would have to report "unchanged" for submodules which were still symlinks to the configured location. I have not yet looked at the implementation details beyond this.
>
> Does this idea make any sense? If I were to implement it (probably in a few months, but no official timeline yet), would patches be considered?
I am happy to review patches.
next prev parent reply other threads:[~2016-10-07 19:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-07 18:17 Uninitialized submodules as symlinks David Turner
2016-10-07 18:56 ` Stefan Beller [this message]
2016-10-07 19:59 ` David Turner
2016-10-17 9:45 ` Duy Nguyen
2016-10-17 15:12 ` David Turner
2016-10-13 16:10 ` Heiko Voigt
2016-10-13 19:35 ` Kevin Daudt
2016-10-14 16:48 ` Junio C Hamano
2016-10-17 9:28 ` Heiko Voigt
2016-10-17 15:11 ` David Turner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGZ79ka1rJCks5np9Q__HAHYFDrdGDFLtquhb3fY_iL8q9DEkw@mail.gmail.com \
--to=sbeller@google.com \
--cc=David.Turner@twosigma.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).