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? |
Fixes #46
I tested this by doing a Miri-push.
Cc @lnicola