-
Notifications
You must be signed in to change notification settings - Fork 6
Small improvements, part 2 #65
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| # Skill: Generate Branch Summary | ||
|
|
||
| ## Purpose | ||
| Generate a concise, structured summary of all changes in the current branch compared to the develop branch. This summary is written to `summary.md` and serves as the single source of truth for understanding what a branch introduces. | ||
|
|
||
| ## When to Use | ||
| - After completing implementation work on a feature branch | ||
| - Before opening a pull request to develop | ||
| - When updating branch documentation | ||
| - To communicate changes clearly to reviewers | ||
|
|
||
| ## Process | ||
|
|
||
| ### 1. Determine Current Branch Context | ||
| ```bash | ||
| git rev-parse --abbrev-ref HEAD # Get current branch name | ||
| git log --oneline -5 # Check recent commits | ||
| ``` | ||
|
|
||
| ### 2. Analyze Changes Relative to Develop | ||
| ```bash | ||
| git diff --stat develop...HEAD # Summary of changed files | ||
| git log --oneline develop..HEAD # Commits in this branch | ||
| git --no-pager diff develop...HEAD # Full diff (use --no-pager to avoid pager issues) | ||
| ``` | ||
|
|
||
| ### 3. Categorize Changes | ||
| Group modifications by their nature: | ||
| - **New APIs/Features** — new interfaces, classes, methods | ||
| - **Performance Optimizations** — efficiency improvements, early-exit checks, reduced allocations | ||
| - **Bug Fixes** — corrections to existing behavior | ||
| - **Refactoring** — internal improvements without behavior change | ||
| - **Documentation** — javadoc, comments, instruction files, style guides | ||
| - **Version Bumps** — changes to version numbers in build.gradle or other config | ||
|
|
||
| ### 4. Structure the Summary | ||
| Create a section in `summary.md` with this format: | ||
|
|
||
| ```markdown | ||
| # Branch: <branch-name> | ||
|
|
||
| **Status:** <Ready for review / In progress / Draft> | ||
| **Commits:** <number> (e.g., "1 (abc1234 - 'commit message')" or "3 commits") | ||
| **Version:** <old-version> → <new-version> (if applicable) | ||
|
|
||
| ## Changes Summary | ||
|
|
||
| ### <Category 1> (e.g., "New Array API") | ||
| - Description of what was added/changed | ||
| - Key implementation details | ||
| - Important behaviors or constraints | ||
|
|
||
| ### <Category 2> (e.g., "Collection Optimization Pattern") | ||
| - Explanation of the optimization | ||
| - Which files/classes affected | ||
| - Methods modified (count if many) | ||
|
|
||
| ### <Category 3> (e.g., "Documentation") | ||
| - What documentation was added | ||
| - Why it matters (e.g., for future contributors) | ||
|
|
||
| ## Testing & Validation | ||
| - `./gradlew :module-name:build` ✅ | ||
| - `./gradlew clean build` (recommended before merge) | ||
| ``` | ||
|
|
||
| ### 5. Key Guidelines for Content | ||
|
|
||
| #### Be Specific | ||
| - ✅ "Added `tryTrimTo(int)` method to safely resize internal storage" | ||
| - ❌ "Added new method" | ||
|
|
||
| #### Quantify When Helpful | ||
| - ✅ "Applied isEmpty() checks to 21 methods across 3 dictionary types" | ||
| - ❌ "Applied optimization across dictionaries" | ||
|
|
||
| #### Explain Impact | ||
| - ✅ "Avoids unnecessary allocations and iterations when collections are empty" | ||
| - ❌ "Performance improvement" | ||
|
|
||
| #### Include Implementation Details | ||
| - ✅ "Returns unchanged if requested size exceeds capacity or is less than current size" | ||
| - ❌ "Has validation logic" | ||
|
|
||
| #### Use Clear Formatting | ||
| - Use markdown headers (`#`, `##`, `###`) for hierarchy | ||
| - Use bullet points for lists | ||
| - Use bold (`**`) for emphasis on key terms | ||
| - Use inline code (`` ` ` ``) for class/method names | ||
|
|
||
| ### 6. Output Location | ||
| Always write to `summary.md` in the repository root, replacing or updating the previous summary section. | ||
|
|
||
| ### 7. Keep Previous Content | ||
| If `summary.md` already contains unrelated sections (e.g., documentation of other work), preserve them unless explicitly asked to remove them. Only update or replace the branch summary section. | ||
|
|
||
| ## Example Output | ||
|
|
||
| ```markdown | ||
| # Branch: update-api-part-2 | ||
|
|
||
| **Status:** Ready for review | ||
| **Commits:** 1 (1367d9b - "small improvements") | ||
| **Version:** 10.0.alpha13 → 10.0.alpha14 | ||
|
|
||
| ## Changes Summary | ||
|
|
||
| ### 1. New Array API: `tryTrimTo(int)` | ||
| - Added `UnsafeMutableArray.tryTrimTo(int internalStorageSize)` method for safe internal storage resizing | ||
| - Implemented in `AbstractMutableArray` with validation: | ||
| - Returns unchanged if requested size exceeds current capacity | ||
| - Returns unchanged if requested size is less than current element count | ||
| - Performs trimming for valid requests | ||
| - Includes complete javadoc with `@since 10.0.alpha14` tag | ||
|
|
||
| ### 2. Collection Optimization Pattern | ||
| Applied early-exit `isEmpty()` checks across dictionary implementations: | ||
| - **AbstractHashBasedIntToRefDictionary:** 7 methods optimized | ||
| - **AbstractHashBasedLongToRefDictionary:** 7 methods optimized | ||
| - **AbstractHashBasedRefToRefDictionary:** 7 methods optimized | ||
|
|
||
| Optimized methods: `iterator()`, `keys()` (all overloads), `values()` (all overloads) | ||
| **Benefit:** Avoids allocations and iterations when collections are empty | ||
|
|
||
| ### 3. Documentation | ||
| - Added comprehensive javadoc to `tryTrimTo()` method | ||
| - Updated `.github/copilot-instructions.md` with "Collections optimization pattern" section | ||
|
|
||
| ## Testing & Validation | ||
| - Module build: `./gradlew :rlib-collections:build` ✅ | ||
| - Full build verification: `./gradlew clean build` (recommended before merge) | ||
| ``` | ||
|
|
||
| ## Common Patterns in RLib | ||
|
|
||
| ### API Additions | ||
| Always mention: | ||
| - Method signature and purpose | ||
| - Return type and parameter descriptions | ||
| - Javadoc status (whether included, version tag) | ||
| - Key behaviors or constraints | ||
|
|
||
| ### Optimizations | ||
| Always mention: | ||
| - What was optimized (method names, counts) | ||
| - Why (avoid allocations, reduce iterations, etc.) | ||
| - Affected files/classes | ||
| - Observable impact | ||
|
|
||
| ### Documentation Changes | ||
| Mention: | ||
| - What was added or updated | ||
| - Why it matters (helps future contributors, clarifies usage, standardizes conventions) | ||
| - Files affected | ||
|
|
||
| ## Tips | ||
|
|
||
| 1. **Use `git diff --stat`** to get a quick overview of which files changed and how many lines | ||
| 2. **Use `git log develop..HEAD`** to list all commits in the branch for reference | ||
| 3. **Extract key insights from the actual diff** — skim the output to understand the nature of changes | ||
| 4. **Be concise** — summaries should be readable in 2-3 minutes | ||
| 5. **Link to code** — mention file paths and method names so reviewers can navigate easily | ||
| 6. **Quantify changes** — "7 methods optimized" is more informative than "several optimizations" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,7 @@ repositories { | |
| } | ||
|
|
||
| ext { | ||
| rlibVersion = "10.0.alpha13" | ||
| rlibVersion = "10.0.alpha14" | ||
| } | ||
|
|
||
| dependencies { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| rootProject.version = "10.0.alpha13" | ||
| rootProject.version = "10.0.alpha14" | ||
| group = 'javasabr.rlib' | ||
|
|
||
| allprojects { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.