Skip to content

refactor(git-core): merge git-worktrees into git-core as a package - #46

Merged
OliverWolffGIP merged 5 commits into
mainfrom
feature/plan-21-merge-worktrees-into-core
Nov 20, 2026
Merged

OliverWolffGIP merged 5 commits into
mainfrom
feature/plan-21-merge-worktrees-into-core

Conversation

@OliverWolffGIP

@OliverWolffGIP OliverWolffGIP commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Removes the Maven module git-worktrees and makes its code the package de.cuioss.git.document.core.worktrees of git-core, before the first release. The change is a move: no worktree operation changes its behaviour, outcome or message text.

Intent

Problem. git-worktrees is a second module that adds no third-party dependency and is about 1,700 lines against about 5,000 in git-core. Every plan has paid for the second module again: an Enforcer block, a domain-term test, a specification, and build and metadata decisions. Module coordinates are cheapest to change before 0.1.0.

Approach. Move the code as the package de.cuioss.git.document.core.worktrees of git-core (git mv, behaviour unchanged). GitWorktreesLogMessages merges into GitCoreLogMessages (INFO 2-4, WARN 102-104; the worktrees refusal stays a separate record, WORKTREE_CAPABILITY_REFUSED = 102). The worktrees requirements are renumbered GDR-WT-1..4 to GDR-CORE-12..15 and ADR-0004 is rewritten in place (both owner decisions). The specification, all documents and the dependency-graph SVG follow the merged module. The test count goes from 883 to 882: the only deleted test is the duplicate git-worktrees DomainTermAbsenceTest.

Non-goals. No behaviour change in any worktree operation. No dependency added or removed; consumer-isolation and module-layering are unchanged. .github/project.yml is untouched, so this is not a release. git-store does not depend on the worktrees package.

Changes

  • Code and tests: the worktrees classes and their seven test classes move from git-worktrees into git-core (git mv); git-core/src/main/java/module-info.java exports both packages.
  • GitWorktreesLogMessages is merged into GitCoreLogMessages (INFO 2-4, WARN 102-104) and git-worktrees/doc/LogMessages.adoc into git-core/doc/LogMessages.adoc; GitOutcome Javadoc names the new package.
  • Build: git-worktrees is removed from the root pom.xml and its directory and POM are deleted; git-core/pom.xml is adapted. module-layering and consumer-isolation are unchanged.
  • DomainTermAbsenceTest of git-core asserts a public type per exported package; the duplicate in git-worktrees is deleted (reactor test count 883 to 882).
  • Specification: doc/specification/git-worktrees.adoc is merged into doc/specification/git-core.adoc (requirements renumbered GDR-WT-1..4 to GDR-CORE-12..15) and doc/specification/general.adoc is adapted.
  • Decisions and documents: ADR-0004 is rewritten in place, ADR-0001 is adapted, and doc/concepts/module-structure.adoc, doc/resources/diagrams/module-dependency-graph.svg, doc/clients/pm-mcp-core.adoc, doc/README.adoc, README.adoc and AGENTS.md are adapted to the merged module.

Test Plan

  • Verification command passed (python3 .plan/execute-script.py plan-marshall:build-maven:maven run --command-args "verify")
  • Manual testing completed (if applicable)

Related Issues

None.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AEE74vgdJL9fmn81BKweSn

Summary by CodeRabbit

  • Changes
    • Linked working-tree operations—including creation, listing, removal, commits, status checks, and branch-reservation release—are now part of the core Git library.
    • Updated module and feature documentation to reflect the consolidated structure.

OliverWolffGIP and others added 4 commits November 20, 2026 17:16
…s a package

The git-worktrees module becomes the package de.cuioss.git.document.core.worktrees
of git-core: main code and tests moved by git mv, the requirement ids GDR-WT-1..4
rewritten to GDR-CORE-12..15, the worktrees log records added to GitCoreLogMessages
(INFO 2-4, WARN 102-104) and the git-worktrees module removed from the reactor.
The git-core DomainTermAbsenceTest now also asserts that every exported package
holds a public type.

Co-Authored-By: plan-marshall <noreply@cuioss.de>
…ore.adoc

The specification of the removed module becomes the part "Working Trees" of
git-core.adoc with its requirements renumbered GDR-CORE-12 to GDR-CORE-15, and
general.adoc names the working-tree operations of git-core instead of the module.

Co-Authored-By: plan-marshall <noreply@cuioss.de>
ADR-0004 now names git-core and git-testing as the JGit foundation and
records that the working-tree operations are the package
de.cuioss.git.document.core.worktrees of git-core; its affects list drops
git-worktrees. ADR-0001 says the working-tree operations of git-core stay
available for consumers that need files. Both stay Accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEE74vgdJL9fmn81BKweSn
… merged module

module-structure.adoc, the module dependency graph, the pm-mcp-core client
document, doc/README.adoc, README.adoc and AGENTS.md describe the working-tree
operations as the package de.cuioss.git.document.core.worktrees of git-core.
The diagram shows six modules, the client section is renamed "What the
Worktrees Package Took and Changed", GDR-WT-1..4 links become GDR-CORE-12..15
and GIT_WORKTREES-101 becomes GIT_CORE-103.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEE74vgdJL9fmn81BKweSn
@sourcery-ai

sourcery-ai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Sorry @OliverWolffGIP, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 2 days and 17 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

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

Next included review available in 35 minutes.

Check out review usage here.

View limit details

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

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 66397e5c-c49e-498b-81f2-28fbfdcb68aa
Commits

Reviewing files that changed from the base of the PR and between 6f5b7cd and 6b45edb.

Files selected for processing: 1

  • git-core/src/main/java/de/cuioss/git/document/core/worktrees/JGitWorktreeOperations.java
Walkthrough

The pull request moves linked-working-tree operations from the separate git-worktrees module into the git-core module. It updates the package export, logging, tests, reactor configuration, specifications, and repository documentation to reflect the consolidation.

Changes: Worktree consolidation

Layer / File(s) Summary
Worktree package and logging in git-core
git-core/src/main/java/de/cuioss/git/document/core/worktrees/*, git-core/src/main/java/de/cuioss/git/document/core/GitCoreLogMessages.java, git-core/src/main/java/module-info.java, doc/specification/git-core.adoc, git-core/doc/LogMessages.adoc, git-worktrees/src/main/java/...
The worktree package is declared under git-core and exported by its module descriptor. Worktree log records are added to GitCoreLogMessages, and the git-core specification documents the operations and outcomes.
Worktree test migration
git-core/src/test/java/de/cuioss/git/document/core/..., git-worktrees/src/test/java/...
Worktree tests move to the git-core package and update log assertions and requirement identifiers. The git-core domain-term test checks that scanned public types cover exported packages.
Reactor and documentation updates
pom.xml, git-worktrees/pom.xml, git-worktrees/src/main/java/module-info.java, AGENTS.md, README.adoc, doc/*
The root reactor and git-worktrees module files are removed. Specifications, architecture documents, client documentation, and repository guidance identify worktree functionality as part of git-core.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Merge Risk: Low · previous review 6f5b7

This moves worktree operations into git-core with no intended behavior change. The remaining concern is that a handwritten outcome table in the specification may drift from the enum later. It is mergeable, but run the full Maven verify build first.

Pre-merge checks: Passed 2

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "refactor(git-core): merge git-worktrees into git-core as a package" matches the main change. The PR removes the git-worktrees Maven module and moves its code and tests into git-core under d…
Full details: Title check

Explanation

The title "refactor(git-core): merge git-worktrees into git-core as a package" matches the main change. The PR removes the git-worktrees Maven module and moves its code and tests into git-core under de.cuioss.git.document.core.worktrees. The title is specific, uses a conventional commit style, and names the affected module and the nature of the change. It does not mention the requirement ID renumbering or the log-message merge, which are secondary details.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ca0747a3-76ab-4603-8d87-3143c886c930
Commits

Reviewing files that changed from the base of the PR and between dd57475 and 6f5b7cd.

Files ignored due to path filters: 1

  • doc/resources/diagrams/module-dependency-graph.svg is excluded by !**/*.svg
Files selected for processing: 32

  • AGENTS.md
  • README.adoc
  • doc/README.adoc
  • doc/adr/0001-Documents_are_written_in_core_without_working_trees_and_references_move_by_compare-and-swap.adoc
  • doc/adr/0004-The_libraries_are_one_reactor_of_separately_consumed_modules_and_the_JGit_foundation_is_shared_with_its_clients.adoc
  • doc/clients/pm-mcp-core.adoc
  • doc/concepts/module-structure.adoc
  • doc/specification/general.adoc
  • doc/specification/git-core.adoc
  • doc/specification/git-worktrees.adoc
  • git-core/doc/LogMessages.adoc
  • git-core/pom.xml
  • git-core/src/main/java/de/cuioss/git/document/core/GitCoreLogMessages.java
  • git-core/src/main/java/de/cuioss/git/document/core/GitOutcome.java
  • git-core/src/main/java/de/cuioss/git/document/core/worktrees/JGitWorktreeOperations.java
  • git-core/src/main/java/de/cuioss/git/document/core/worktrees/LinkedWorktrees.java
  • git-core/src/main/java/de/cuioss/git/document/core/worktrees/WorktreeOperations.java
  • git-core/src/main/java/de/cuioss/git/document/core/worktrees/package-info.java
  • git-core/src/main/java/module-info.java
  • git-core/src/test/java/de/cuioss/git/document/core/DomainTermAbsenceTest.java
  • git-core/src/test/java/de/cuioss/git/document/core/worktrees/AbsenceContractsTest.java
  • git-core/src/test/java/de/cuioss/git/document/core/worktrees/GitWorktreeListCompatibilityTest.java
  • git-core/src/test/java/de/cuioss/git/document/core/worktrees/JGitWorktreeOperationsTest.java
  • git-core/src/test/java/de/cuioss/git/document/core/worktrees/LinkedWorktreesTest.java
  • git-core/src/test/java/de/cuioss/git/document/core/worktrees/WorktreeOperationsRecordsTest.java
  • git-core/src/test/java/de/cuioss/git/document/core/worktrees/WorktreeStatusTest.java
  • git-worktrees/doc/LogMessages.adoc
  • git-worktrees/pom.xml
  • git-worktrees/src/main/java/de/cuioss/git/document/worktrees/GitWorktreesLogMessages.java
  • git-worktrees/src/main/java/module-info.java
  • git-worktrees/src/test/java/de/cuioss/git/document/worktrees/DomainTermAbsenceTest.java
  • pom.xml
Files with no reviewable changes: 7

  • doc/specification/git-worktrees.adoc
  • git-worktrees/doc/LogMessages.adoc
  • git-worktrees/pom.xml
  • git-worktrees/src/main/java/de/cuioss/git/document/worktrees/GitWorktreesLogMessages.java
  • git-worktrees/src/main/java/module-info.java
  • git-worktrees/src/test/java/de/cuioss/git/document/worktrees/DomainTermAbsenceTest.java
  • pom.xml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread doc/specification/general.adoc Resolved
@OliverWolffGIP

Copy link
Copy Markdown
Collaborator Author

Triage dispositions

In reply to comment_id: PRR_kwDOVwLcIM8AAAABZWPMbg

Review summary only (1 actionable comment). That comment, on doc/specification/general.adoc, is answered in its own thread; nothing else in this review body asks for a change.

In reply to comment_id: IC_kwDOVwLcIM8AAAABo-VyJA

Walkthrough and merge-risk summary (risk Low, mergeable). Its one remark, the hand-written outcome table, is answered in the inline thread: GitOutcomeSpecificationTest already fails the build on drift. The OSV Scanner warning (exit code 127) is a failure of the scanner run itself, not a finding about the change; this PR touches no dependency.

JGitWorktreeOperations.existingBranchStart reads Ref.getObjectId() into a
local, refuses with NOT_FOUND when it is null and passes that local to
StartPoint.of, so the null flow is visible to Sonar (java:S4449). Ref.getObjectId()
is @nullable in JGit 7.8.0.202609011348-r. Results, outcomes, messages and the
order of the checks are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEE74vgdJL9fmn81BKweSn

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

@OliverWolffGIP

Copy link
Copy Markdown
Collaborator Author

Triage dispositions

In reply to comment_id: PRR_kwDOVwLcIM8AAAABZWdllA

Sourcery review of 6b45edb is an approval with no concern raised; nothing to change.

@OliverWolffGIP
OliverWolffGIP added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 9e3cfb0 Nov 20, 2026
16 checks passed
@OliverWolffGIP
OliverWolffGIP deleted the feature/plan-21-merge-worktrees-into-core branch November 20, 2026 17:40
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.

1 participant