Open novalis opened 7 years ago
And if you close the submodule, it doesn't push at all.
The way it works right now is... expedient. I'm not sure that it's tractable to figure out what the exact right set of submodule commits to push is. To do so, you'd first need to determine what meta-repo commits haven't been pushed -- which is always going to be a guess, and which could range between mildly and extremely expensive (e.g., of the user has removed all remote branches you might deduce that all of history is being pushed).
I think a better algorithm than what I currently have (that would address @novalis 's issue) would be to push, for each open submodule, the commit referenced at the tip of the meta-repo commit being pushed. Final validation will have to happen on the back-end as we really have no idea of what's there, unless we want to teach git-meta how to participate in the negotiation process.
Under the assumption that you only push one commit at a time, it would seem simple to examine the tip of the outgoing branch, and push to a synthetic meta ref every submodule changed in that commit.
Why would we assume that users push only one commit at a time?
I know it's not philosophically pure, but neither is the currently-implemented solution, and approximately 100% of real-world usage of git meta to date has been one commit at a time. :)
I think it's OK to use that point as an optimization, but I don't think the tool should be broken if someone has more than one commit.
Agreed. But the tool is currently broken if you (a) have a different commit checked out than the one you're pushing or (b) have closed some changed submodules since git-adding them. It doesn't seem obvious to me that "pushing multiple meta commits" is a more common operaton than that (even in a future when we support "assembling" them).
How about we push (a) open submodules and (b) any submodules changed in the commit being pushed (opening them if necessary)?
sounds good to me!
If I make a commit in submodule A, and then make a meta commit, and then make another commit in submodule A, git meta push will push the second submodule A commit -- not the one that is in the meta commit being pushed.