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

Provide a way to remove the old commits #575

Open
minwoox opened this issue Apr 1, 2021 · 0 comments · May be fixed by #681
Open

Provide a way to remove the old commits #575

minwoox opened this issue Apr 1, 2021 · 0 comments · May be fixed by #681

Comments

@minwoox
Copy link
Member

minwoox commented Apr 1, 2021

Central Dogma uses jGit to store data. Due to the nature of Git that stores unlimited history,
Central Dogma will eventually get in trouble managing disk usage.
We can handle this by removing old commits that are not used anymore. In order to do that, we cannot just
use Git squash because that changes the hash of the commits.

So what we are going to do is (that is suggested by @trustin):

  • Creating a new Git repository whenever the commits of the previously created repository
    reaches a certain number(N).
    • So we are going to have R, R + 1, R + 2, R + 3, ...
    • When we create the repository R + 2, we can remove the repository created two times earlier that is R in this case.
      (We can also use a batch to remove that)
    • We are going to store at most 2N history.
  • Limiting the number of history that a user can get to N
    • That means that Revision.INIT is not 1 anymore. It will be max(1, Revision.HEAD - N + 1)
minwoox added a commit to minwoox/centraldogma that referenced this issue Apr 15, 2021
Motivation:
To implement line#575, we should be able to make diffs between two different repositories.

Modifications:
- Add `TwoRepositoriesDiffFormatter` and `TwoRepositoriesTreeWalk` to make diffes between two different repositories.
- Misc
  - Use `@TempDir` in `GitRepositoryManagerTest` so that the temporarily created directories for the test are not left anymore.

Result:
- Ready to implement line#575
minwoox added a commit to minwoox/centraldogma that referenced this issue Apr 15, 2021
Motivation:
To implement line#575, we should be able to make diffs between two different repositories.

Modifications:
- Add `TwoRepositoriesDiffFormatter` and `TwoRepositoriesTreeWalk` to make diffes between two different repositories.
- Misc
  - Use `@TempDir` in `GitRepositoryManagerTest` so that the temporarily created directories for the test are not left anymore.

Result:
- Ready to implement line#575
minwoox added a commit to minwoox/centraldogma that referenced this issue Jul 6, 2021
Motivation:
We no longer need Git gc because we are going to provide a way to remove old commits.
line#575

Modifications:
- Revert Git gc.

Result:
- This reverts commit e6caf26.
minwoox added a commit that referenced this issue Jul 6, 2021
Motivation:
We no longer need Git gc because we are going to provide a way to remove old commits.
#575

Modifications:
- Revert Git gc.

Result:
- This reverts commit e6caf26.
@minwoox minwoox linked a pull request Feb 23, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant