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

repo: load index eagerly to simplify error handling #4133

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Jul 21, 2024

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

If readonly_index() and index() returned Result, it would propagate to many
call sites. That seems bad for API ergonomics. Suppose most "repo" commands
depend on an index, I think it's okay to load index eagerly:

 - "jj config" doesn't load repo (nor index)
 - "jj workspace root" doesn't load repo (nor index)
 - some other mutation commands load index when printing commit summary
 - many other commands load index when resolving revset
@yuja yuja force-pushed the push-ozpwntmulmnz branch from bec0fb3 to fb72965 Compare July 23, 2024 09:14
@yuja yuja enabled auto-merge (rebase) July 23, 2024 09:20
@yuja yuja merged commit da221eb into jj-vcs:main Jul 23, 2024
17 checks passed
@yuja yuja deleted the push-ozpwntmulmnz branch July 23, 2024 09:26
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.

2 participants