Skip to content
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

POC for GitBackend opening worktrees #4801

Draft
wants to merge 6 commits into
base: workspace-colocate-minimal
Choose a base branch
from

Conversation

cormacrelf
Copy link
Collaborator

Just to illustrate what #4644 could do differently. See discussion there.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

We want to check for colocated workspaces in the GitBackend
initialization code. So it has to move to jj_lib.
This does the plumbing but does not actually use it.
- Save the colocation warning on GitBackend
- try reopening as colocated during GitBackend::init_external, in addition to during ::load
- Open the workspace root if colocated in GitBackend::load
This is just so incredibly hacky. Proof of concept only.
No longer necessary. GitBackend has already opened the correct repo.
So we may simply get the store's git backend and read the HEAD from it.

We do NOT remove the repository parameter from git::reset_head, because:

- it has had this param since before the worktree code came around
- it still uses `git2::Repository` and judging from a token attempt,
  converting this code is a lot of work.

But, at least in theory, git::reset_head can just use the `gix::Repository`
on the GitBackend.
@cormacrelf cormacrelf mentioned this pull request Nov 8, 2024
4 tasks
@cormacrelf cormacrelf changed the title Git backend worktree POC for GitBackend opening worktrees Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant