When a loom branch has previously had merges from the parent branch, or if more than 20 commits would be rebased, a "rebase" should merge from the parent branch instead of rebasing#1017
Conversation
Enhancement Analysis — Issue #1016
Enhancement AnalysisQuestions for Reporter
Problem Summary When a loom branch either (a) already contains merge commits from the parent branch or (b) has accumulated a large number of commits (more than 20), the current User Impact Users working on long-lived branches or branches where they have previously merged from main encounter painful rebase conflicts, duplicated history, or outright rebase failures during Enhancement Goal Automatically detect when a rebase would be problematic (merge history present, or commit count exceeds threshold) and seamlessly fall back to a merge-from-parent strategy, preserving a safe and predictable branch synchronization experience without requiring manual intervention. Next Steps
Complete Context and Details (click to expand)Current Behavior iloom performs rebases in two contexts relevant to this issue:
Out of Scope: Swarm orchestrator child-to-epic merge flow is excluded — it's more controlled and doesn't need this fallback. Scenarios Where Rebase Is Problematic
Affected Surfaces
Relationship to Existing Configuration The History Model Implications When merge-from-parent is chosen instead of rebase, the branch will contain merge commits. This means:
|
Deep Technical Analysis — Issue #1016
Status: Mapped all rebase call sites. Now analyzing merge flows and detection logic requirements. |
Deep Technical Analysis -- Issue #1016 (Smart Rebase/Merge)
Executive Summary
Scope (per user): Applies to Questions and Key Decisions
HIGH/CRITICAL Risks
Impact Summary
Complete Technical Reference (click to expand for implementation details)Problem Space ResearchProblem UnderstandingWhen a loom branch has merge commits from the parent branch (e.g., user ran Architectural Context
Edge Cases Identified
Codebase Research FindingsAffected Area: MergeManager.rebaseOnMain()Entry Point:
Key internal flow (lines 45-213):
Affected Area: FinishCommand.executeIssueWorkflow()Entry Point:
Affected Area: performFastForwardMerge()Entry Point:
Detection Logic RequiredTwo conditions trigger merge-from-parent instead of rebase: 1. Merge commit detection (any merge commits in branch range): If output is non-empty, merge commits exist. This is a simple git command. 2. Commit count threshold (default: 20): Architectural Flow AnalysisData Flow: rebase strategy decisionEntry Point:
Consumption Points:
Data Flow: rebase threshold configurationEntry Point:
Affected Interfaces (ALL must be updated):
Critical Implementation Note: This is a cross-cutting change affecting the return type of Affected Files
Integration Points
Medium Severity Risks
|
Implementation Plan -- Issue #1016
Status: Drafting the full implementation plan now. |
Implementation Plan for Issue #1016SummaryWhen a loom branch contains merge commits from the parent branch, or has accumulated more commits than a configurable threshold (default: 20), Questions and Key Decisions
High-Level Execution Phases
Quick Stats
Potential Risks (HIGH/CRITICAL only)
Complete Implementation Guide (click to expand for step-by-step details)Automated Test Cases to CreateTest File:
|
Implementation CompleteSummaryImplemented smart rebase/merge strategy detection for Changes Made
Validation Results
Detailed Changes by File (click to expand)src/lib/MergeManager.tsChanges: Core smart rebase/merge logic
src/lib/SettingsManager.tsChanges: New
src/commands/finish.tsChanges: Strategy-aware local merge
src/commands/rebase.tsChanges: Strategy reporting
src/lib/MergeManager.test.tsChanges: 19 new tests + fixture updates
src/commands/finish.test.ts + rebase.test.ts + finish.pr-workflow.test.tsChanges: Mock updates and new tests
|
769a97e to
c219bdb
Compare
Implementation Complete - Issue #1016 ✅SummaryFixed three bugs in the smart rebase/merge feature: reordered strategy detection before the "already up to date" early-return check, replaced all hardcoded "rebase" and "main" messages with strategy-aware and target-branch-aware text, and added Changes Made
Validation Results
📋 Detailed Changes by File (click to expand)Files Modified
|
When a loom branch has merge commits from the parent branch or exceeds a configurable commit count threshold (default 20), automatically fall back to merge-from-parent instead of rebasing. Applies to `il rebase` and all `il finish` modes (local, PR, draft-PR). - Detect merge commits from parent via precise ancestry check - Add `rebase.maxCommitsForRebase` setting (0=always merge, <0=disable) - Propagate strategy through RebaseOutcome so finish uses --no-ff merge - Add telemetry, tests (19 new MergeManager + 4 command tests), and docs - Fix pre-existing ignite test failures (model string was env-dependent)
…messaging Strategy detection (merge-commit detection + commit count threshold) now runs before the "already up to date" early return so branches with prior merges from parent are correctly handled. All user-facing messages are now strategy-aware and use the actual target branch name instead of hardcoding "main". Added targetBranch to RebaseOutcome for callers.
afefee6 to
c40c18d
Compare
iloom Session SummaryKey Themes:
Session Details (click to expand)Key Insights
Decisions Made
Challenges Resolved
Lessons Learned
Generated with 🤖❤️ by iloom.ai |
Fixes #1016
When a loom branch has previously had merges from the parent branch, or if more than 10 commits would be rebased, a "rebase" should merge from the parent branch instead of rebasing
This PR was created automatically by iloom.