Skip to content

Fix #198: Use RevWalk with RevSort.REVERSE in countingVersion - #203

Merged
gnodet merged 1 commit into
mainfrom
fix-198-refactor-countingversion-in-jgitproperty
Aug 25, 2026
Merged

gnodet merged 1 commit into
mainfrom
fix-198-refactor-countingversion-in-jgitproperty

Conversation

@gnodet

@gnodet gnodet commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces ArrayList-based commit collection and Collections.reverse() in resolveCountingVersion with JGit's RevWalk using RevSort.REVERSE
  • Commits are now streamed oldest-first directly from the RevWalk iterator, eliminating O(N) memory allocation for the full commit history
  • Prevents GC pressure and potential OOM on large repositories (e.g. 40k+ commits)

Closes #198

Test plan

  • All 34 existing JGitPropertySourceTest tests pass (including 8 counting-version-specific tests)
  • Full reactor build passes (./mvnw clean install -B)
  • CI passes

🤖 Generated with Claude Code

Replace ArrayList-based commit collection and reversal with JGit's
RevWalk using RevSort.REVERSE to stream commits oldest-first. This
eliminates O(N) memory allocation for the full commit history, which
could cause GC pressure or OOM on large repositories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 57 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d6454255-a06f-4209-bde1-9a98411d4c8c

📥 Commits

Reviewing files that changed from the base of the PR and between 7ea9f8d and 9823382.

📒 Files selected for processing (1)
  • sources/jgit-source/src/main/java/eu/maveniverse/maven/nisse/source/jgit/JGitPropertySource.java

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gnodet
gnodet merged commit e7d8720 into main Aug 25, 2026
17 checks passed
@gnodet
gnodet deleted the fix-198-refactor-countingversion-in-jgitproperty branch August 25, 2026 08:00
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.

countingVersion loads entire commit history into memory

1 participant