Skip to content

fix(inkless:sync): improve branch consistency check and add cherry-pick sync guide#550

Open
jeqo wants to merge 2 commits intomainfrom
jeqo/fix-branch-consistency-check
Open

fix(inkless:sync): improve branch consistency check and add cherry-pick sync guide#550
jeqo wants to merge 2 commits intomainfrom
jeqo/fix-branch-consistency-check

Conversation

@jeqo
Copy link
Copy Markdown
Contributor

@jeqo jeqo commented Mar 23, 2026

  • Fix branch-consistency.sh to use --first-parent when listing main commits, so upstream merge-commit content is excluded from the missing-commits report.
  • Add comprehensive cherry-pick sync documentation covering the workflow, conflict resolution patterns, and session tracking for backporting inkless commits from main to release branches (e.g., inkless-4.0).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the inkless sync tooling to (1) improve how missing commits are identified between main and release branches, and (2) document a repeatable workflow for cherry-picking inkless features from main into release branches.

Changes:

  • Update branch-consistency.sh to scan origin/main using git log --first-parent so merged-in upstream history is not treated as “missing”.
  • Update cherry-pick-to-release.sh to present/execute commit lists oldest-first (while preserving user-provided ordering for explicit commit lists).
  • Add cherry-pick sync documentation, conflict patterns, and a session template, and link them from the sync README.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
inkless-sync/cherry-pick-to-release.sh Reorders the commit list for display/execution (oldest-first by default).
inkless-sync/branch-consistency.sh Switches main scanning to --first-parent and changes commit filtering logic.
inkless-sync/README.md Documents “Cherry-pick Sync” as a third sync type and links new guide/template.
inkless-sync/CONFLICT-RESOLUTION-STRATEGY.md Adds cherry-pick-specific conflict categories and tracking guidance.
inkless-sync/CHERRY-PICK-SYNC-GUIDE.md New end-to-end guide for cherry-pick sync workflow and troubleshooting.
inkless-sync/CHERRY-PICK-SESSION-TEMPLATE.md New template for tracking cherry-pick sessions and resolutions.
Comments suppressed due to low confidence (1)

inkless-sync/branch-consistency.sh:188

  • The script still prints "Scanning main branch for inkless commits..." / "Found X inkless-specific commits on main", but the current filtering only removes sync + non-PR commits. If you keep the broader filter intentionally, these messages and the table header (Inkless commits on main) will be misleading; otherwise, reinstate inkless/diskless filtering so the reported counts match the script's stated purpose.
    # Get all inkless commits on main since divergence.
    # --first-parent only walks the main branch lineage, so upstream commits
    # brought in via merge are excluded. Only PRs landed directly on main
    # (and sync fix-ups) appear. We then filter out sync fix-ups.
    info "Scanning main branch for inkless commits..."

    local inkless_commits_file
    inkless_commits_file=$(mktemp)
    # Use RETURN trap for function-scoped cleanup (doesn't persist after function returns)
    trap "rm -f '$inkless_commits_file'" RETURN

    while IFS= read -r line; do
        local msg="${line#* }"
        if ! is_excluded_commit "$msg"; then
            echo "$line" >> "$inkless_commits_file"
        fi
    done < <(git log --first-parent --no-merges --oneline "$diverge_point..origin/main")

    local inkless_count
    inkless_count=$(wc -l < "$inkless_commits_file" | tr -d ' ')
    echo "Found $inkless_count inkless-specific commits on main"
    echo ""

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread inkless-sync/branch-consistency.sh
Comment thread inkless-sync/cherry-pick-to-release.sh Outdated
jeqo and others added 2 commits March 24, 2026 07:08
…anch-consistency

Replace keyword-based inkless commit detection (matching "inkless/diskless"
in message) with --first-parent git log traversal. This only walks the main
branch lineage, so upstream commits brought in via merge are naturally
excluded. All remaining commits with a PR number are inkless PRs regardless
of their commit message wording.

This fixes commits like "feat(produce): optimize AppendCompleter (#529)"
being missed because they don't mention "inkless" or "diskless".

Also fixes cherry-pick-to-release.sh to apply commits oldest-first instead
of newest-first, ensuring dependencies are met.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add documentation for cherry-picking inkless commits from main to
release branches, covering workflow, conflict resolution patterns
(TopicPartition vs TopicIdPartition, missing features, interface
expansion, class coexistence), and session tracking.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@jeqo jeqo force-pushed the jeqo/fix-branch-consistency-check branch from 06a2844 to 2b9eb5f Compare March 24, 2026 12:08
@jeqo jeqo marked this pull request as ready for review March 24, 2026 12:15
@jeqo jeqo requested a review from AnatolyPopov March 24, 2026 12:15
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.

2 participants