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

Deepen shallow clones before running diff #27

Merged
merged 7 commits into from
Apr 1, 2021
Merged

Deepen shallow clones before running diff #27

merged 7 commits into from
Apr 1, 2021

Conversation

shiroyasha
Copy link
Contributor

@shiroyasha shiroyasha commented Mar 30, 2021

If the cloned repository is not deep enough (cloned with --depth N), the change_in evaluation fails.

In this PR, we are introducing a procedure for an iterative deepening of the git history until change_in is ready to be resolved.

Demonstrative pseudocode:

while gitDiffIsFailing? do
  run "git fetch --deepen 100"
end

We are running with an iterative approach instead of a full clone in order to better support large git repositories. For example, a full git clone can be 80gb, but the relevant parts (the last N commits) might be much lighter.

The iterative deepening will halt with an error at 10,000 commits. This should be enough for most, if not all use cases.

When this change is introduced, the output of the CLI will be:

Screenshot 2021-03-31 at 15 52 17

@shiroyasha shiroyasha changed the title Deepen shallow clones before running diff [wip] Deepen shallow clones before running diff Mar 30, 2021
@shiroyasha shiroyasha changed the title [wip] Deepen shallow clones before running diff Deepen shallow clones before running diff Mar 31, 2021
@shiroyasha
Copy link
Contributor Author

shiroyasha commented Mar 31, 2021

Update:

  • removed the unnecessary string() conversions.
  • Introduced exponential deepening, 100, 200, 400, ... commits.

cc @DamjanBecirovic

@shiroyasha shiroyasha merged commit 8cd13f6 into master Apr 1, 2021
@shiroyasha shiroyasha deleted the unshallow branch April 1, 2021 10:14
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.

None yet

2 participants