ziglang / zig-bootstrap

take off every zig
376 stars 91 forks source link

Why is `/zig` not a Git submodule? #163

Closed jonathanmarvens closed 9 months ago

jonathanmarvens commented 9 months ago

I use zig-bootstrap for local development. It makes it convenient for me to build and use Zig as I or mainstream contributors make updates to it (e.g., https://github.com/ziglang/zig/pull/18391). Locally, I've turned the /zig directory into a Git submodule that tracks my fork of Zig. It works great as I can test out features I like and even implement my own features on separate branches (e.g., I have some local modifications to the standard library for certain use cases). The problem is, it's a bit annoying to manage when this repo is updated, which made me wonder, why is this repo using full-blown copies rather than submodules? Maybe I'm missing some important context, but it seems using submodules (as I've done locally) would be the most seamless way to manage the /zig directory.

andrewrk commented 9 months ago

git submodules have a bunch of design flaws that make them not worth using. I don't want to spend too much time complaining, but suffice to say that if you clone the repository currently, you get all the files. If we used git submodules, that would not be the case. That's already a showstopper for me, but it's only just the beginning of my complaints about git submodules.

This repository is not really designed to be used by users of zig directly; it's more geared towards creating releases. For local development the recommended workflow is documented here: https://github.com/ziglang/zig/wiki/Contributing#editing-source-code

That said, whatever works for you is fine, I'm glad you have found a smooth workflow.

jonathanmarvens commented 9 months ago

@andrewrk Thank you. That makes sense. Thank you for your prompt response. I appreciate it. Have a great day!