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

git_backend: on gc(), remove unreachable no-gc refs and compact them #2839

Merged
merged 5 commits into from
Jan 27, 2024

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Jan 17, 2024

#12

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

@yuja yuja force-pushed the push-wnzpqsmmsqty branch 2 times, most recently from 925da56 to 3605edc Compare January 18, 2024 02:50
@yuja yuja force-pushed the push-wnzpqsmmsqty branch from 3605edc to 89fdf39 Compare January 25, 2024 01:36
@martinvonz
Copy link
Member

Wait, did you send this 9 days ago!? Please don't hesitate to remind me to take a look at PRs if you haven't heard from me within two days or so. It might be that I'm just busy with other things, but it's probably more likely that I missed it (like in this case).

Copy link
Member

@martinvonz martinvonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

yuja added 5 commits January 27, 2024 10:06
The inner error should be the source, and I don't think the "Error:" prefix
gives additional context.
The gc() implementation is likely to call other backend functions, which
return BackendError.
… GIT_DIR

Hopefully this will be more reliable on Windows where path/environment stuff
is messy.
GitBackend::gc() will need to check if a commit is reachable from any
historical operations. This could be calculated from the view and commit
objects, but the Index will do a better job.
With my jj repo, the number of jj/keep refs went down from 87887 to 27733.
The .git directory size is halved, but we'll need to clean up extra and index
files to save disk space. "git gc --prune=now && jj debug reindex" passed, so
the repo wouldn't be corrupted.

jj-vcs#12
@yuja yuja force-pushed the push-wnzpqsmmsqty branch from 89fdf39 to 1998e7f Compare January 27, 2024 01:09
@yuja yuja enabled auto-merge (rebase) January 27, 2024 01:09
@yuja yuja merged commit 3d0b3d5 into jj-vcs:main Jan 27, 2024
15 checks passed
@yuja yuja deleted the push-wnzpqsmmsqty branch January 27, 2024 01:18
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