push: base new branch on latest upstream main#47
push: base new branch on latest upstream main#47RalfJung wants to merge 1 commit intorust-lang:mainfrom
Conversation
| "push", | ||
| &user_upstream_url, | ||
| &format!("{base_upstream_sha}:refs/heads/{branch}"), | ||
| &format!("FETCH_HEAD:refs/heads/{branch}"), |
There was a problem hiding this comment.
Here we rely on nothing else working on the same git repo concurrently as that could clobber FETCH_HEAD...
There was a problem hiding this comment.
Not that it's the biggest concern, but you can be robust against this by replacing base_upstream_sha with the equivalent of the below rather than relying on FETCH_HEAD:
$ git ls-remote https://github.com/rust-lang/rust refs/heads/main
f676c20edd32321e9fa2781543d8970109707e30 refs/heads/main
(this is a fast operation unlike the fetch itself)
|
Maybe it's worth having a CLI argument to override the base? I think that with this change, running twice could get you two different results if r-l/r has an update in the meantime. |
The entire reason why we're doing this is that this is already the case. That's what caused this problem. That's what I tried to explain in #46. |
|
Hm - I meant for the purpose of being able to rerun locally and use the same base within a small timescale to pull in a few new commits on top of the existing tree, without changing the history that I've already looked through and verified. Not typically long enough to run into the problem. But that's not overly useful so 🤷 Nothing is going to be completely robust against the race here if that operation isn't durable, unless we do something like fail the merge in CI if new changes happened while the subtree sync was in the queue. |
|
Yeah this assumes that pushes are totally ordered. Which seems like a reasonable requirement, subtrees should coordinate about who's doing syncs (or maybe we can even mostly automate them). |
|
I just tied to do another miri push sync with this and got an error: @christian-schilling any idea what is happening here? |
|
Yes. Josh will choose the "oldest" (by topology, not date of course) commit in the target which filters to a commit in the branch being pushed to serve as a common ancestor. That means the result will in general not be a descendant of the target tip. We never really used it that way (fast forwarding exsting branches from projections), but rather used the |
|
Ah, I didn't realize that this is different from |
|
Ah. Well the users main does not need to be synced with upstream. It just needs contain the the common ancestor. This should be the case if the users fork of the subtree is also based on the users fork of upstream rust. |
|
Instead of the surprising interaction of updating the forks |
32f95ce to
333f758
Compare
333f758 to
94b1676
Compare
|
I updated the PR to use the |
|
Though strangely this push took multiple minutes despite being tiny. It's almost as if somehow it couldn't reuse the cache as well as it usually does. |
Most likely you're seeing the perf issue that was addressed in josh-project/josh#1665 So this will require updating. Which will require setting the backwards compatibility options on the filter. Miri needs both the crlf and the keep trivial option. |
Well, it works, it's just slow. ;) But yeah, updating would be good now that finally 🎉 there is a new release. But that's #42.
Would be nice to also include that in the migration docs. :) |
Fixes #46
I tested this by doing a Miri-push.
Cc @lnicola