Closed langfield closed 1 year ago
Yes, it should probably be a ki
command. Some possible names:
ki split
ki separate
ki submodule
ki submodule add
It is definitely kind of annoying to have to call this from the cloned ki
repository.
Maybe this should be called subdeck
?
Instead of having submodules in ki repositories, instead we could have a subdecks directory that is in the gitignore. For each deck that we want tracked on github, we have a directory called deck1
, deck2
, etc. These are git repositories, but they're purely local, and as I said, not submodules or subrepos or anything. Completely separate. When we've pulled changes into our FLAT ki repository, we have a make recipe that dirty-copies all the data from the deck1
directory in the ki repository into the deck1
subdirectory under subdecks/
. Then it adds these changes and commits them. So it probably just computes a patch or something and applies the patch (so we get deletions as well). Then the user has another deck1
repo somewhere on their machine, and this one has 2 remotes. The first is the ordinary one, which they can use to push to github or whatever. The second points to the subdecks/deck1
repo in the ki repository root directory, and this is where they pull changes from.
To push changes back up to the ki repository from the local copy of deck1
...
Pull latest changes from the ki repository into the subdeck via a patch. We can compute the correct revision to diff against by storing a tag. Then we can do diff <tag> HEAD -- <subdeck>
. Call this
Pull changes from subdeck to the local copy (call this
Compute a patch from the
They're gone! 😁
Should we make
submodule.py
aki
subcommand? ~They might not want a remote at all, so probably best to remove it.~ The way submodules works makes this a bad idea. Don't do this.It is also unclear if this should be a core
ki
command. It relies on some functions in__init__.py
, as well as bindings togit-filter-repo
, so a Haskell port will be a bit nontrivial. However, it does seem like a pretty important thing. 🤷🏻♀️