-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git sync: Setup scaffolding #4824
base: essiene/pmwupzxmwsqz
Are you sure you want to change the base?
Conversation
9720683
to
a28c7e1
Compare
084797c
to
845892d
Compare
344f0ae
to
1225a22
Compare
845892d
to
c1da3c8
Compare
e4de5bc
to
a31e01d
Compare
5f24508
to
9b0981d
Compare
240a7e0
to
bebcc8b
Compare
9b0981d
to
b826c8c
Compare
bebcc8b
to
5cf013a
Compare
eba2a6e
to
371b264
Compare
b826c8c
to
3e6479b
Compare
371b264
to
37c266c
Compare
3e6479b
to
0a540a3
Compare
0a540a3
to
67f4f0c
Compare
37c266c
to
a7661c9
Compare
I prefer to see it split up so the |
This makes sense. Let me see how best to rework it to end up with most changes in |
a7661c9
to
6c900a1
Compare
60c695f
to
d1248e3
Compare
6c900a1
to
d06fa9d
Compare
d1248e3
to
4d59421
Compare
Similarly to `git_fetch`, this will be used in `jj git sync`, so moving this out to maintain the same behaviour across `fetch` command and `sync`. * Refactor out `get_fetch_remotes` to `git_util.rs`. * inline the different `get_*_remote*` functions into `get_fetch_remotes`; The resulting function is still small enough to be easily readable. * Move `get_single_remote` into `git_util.rs` and update call sites. * Use common FetchArgs to pass arguments both to `get_fetch_remotes` and `git_fetch` * Update use references All tests still pass. Issue: #1039
## Summary * [X] Get branch pre-fetch heads * [X] Build candidates from prefetch heads * [X] Fetch from remotes * [X] Get branch post-fetch heads * [X] Rebase * [X] Build old -> new map * [X] transform descendants # git sync: Setup scaffolding ## Details * First commit that just sets up scaffolding. * `jj git sync` is hidden as it's not yet ready. * Set up some tracing guards which will help debugging when run with --debug. # git sync: Get branch heads and fetch from remote. ## Details * For branch heads, we grab local branches matching the pattern specified in args. * Pre-fetch heads query tx.base_repo() while post-fetch heads query tx.repo(); tx.repo() is the in memory Mutable repo which is updated after a fetch in a transaction. * We fetch from all branches from all configured remotes. --all_remotes affects if we use `git.fetch` or all repo remotes. # git sync: Build candidate commits. ## Details * Candidate commits (parent_id, child_id) are: * branch commits * and their descendants * which are not found in untracked remote branches # git sync: Build update record ## Details Build a record of old branch heads mapped to the new branch heads. This record will be used to derive the candidates that need rebasing. # git sync: unhide `jj git sync` ## Details * Add tests * Unhide the command, now that it's complete. * Update CHANGELOG # git sync: Rebase commits onto new branch heads. ## Details * implement CommitRewritter::repo() to return an immutable reference. * transform_descendants() roots are candidates with parents in update_record. * simplify parent merge * drop newly emptied commits * update new parents from the updated heads set if the old parents are ancestors. Issue: #1039
d06fa9d
to
174600a
Compare
The chain of commits is long, so I'm splitting them up for ease of review, starting
with this simple scaffolding PR.
I'm not sure if there's a better way to handle the splits though, I'm happy to adjust in that case.
jj git sync
is hidden as it's not yet ready.Issue: #1039