Skip to content

Replace custom merge driver with built-in merge=ours#146

Merged
blooop merged 2 commits intomainfrom
feature/mergedriver
Mar 1, 2026
Merged

Replace custom merge driver with built-in merge=ours#146
blooop merged 2 commits intomainfrom
feature/mergedriver

Conversation

@blooop
Copy link
Owner

@blooop blooop commented Mar 1, 2026

Summary

  • Replaced the custom ourslock merge driver with Git's built-in merge=ours driver in .gitattributes
  • Removed the setup-git-merge-driver pixi task from pyproject.toml
  • Removed the merge driver setup block from .claude/hooks/SessionStart

The custom driver required per-clone git config setup which was fragile — if missed, Git silently fell back to 3-way merge producing nonsensical conflicts in pixi.lock. The built-in merge=ours works from .gitattributes alone with zero local configuration.

Test plan

  • git check-attr merge pixi.lock returns merge: ours
  • pixi task list | grep merge returns nothing
  • pixi run ci passes

🤖 Generated with Claude Code

Summary by Sourcery

Replace the custom pixi.lock merge driver setup with Git's built-in merge=ours configuration and remove associated local setup hooks and tasks.

Build:

  • Remove the pixi task that configured the custom ourslock Git merge driver from pyproject.toml.

Chores:

  • Remove the custom merge driver setup block from the Claude SessionStart hook and rely on .gitattributes using merge=ours for pixi.lock.

The custom merge driver required per-clone git config setup which was
fragile. Git's built-in merge=ours driver works from .gitattributes
alone with zero local configuration.
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 1, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR removes the custom ourslock Git merge driver in favor of Git’s built-in merge=ours for pixi.lock, cleaning up supporting tasks and hooks so the behavior is driven solely by .gitattributes with no per-clone configuration required.

Sequence diagram for pixi.lock merge behavior before vs after using merge=ours

sequenceDiagram
    actor Developer
    participant Git
    participant Repo

    rect rgb(240,240,240)
        note over Developer,Git: Before PR (custom ourslock driver)
        Developer->>Git: git merge feature
        Git->>Repo: Read .gitattributes for pixi.lock
        alt Local clone has custom ourslock configured
            Git->>Git: Use merge driver ourslock
            Git-->>Developer: pixi.lock from current branch kept
        else No local driver configured (missing setup)
            Git->>Git: Fallback to 3 way merge
            Git-->>Developer: pixi.lock with merge conflicts
        end
    end

    rect rgb(220,255,220)
        note over Developer,Git: After PR (built in merge=ours)
        Developer->>Git: git merge feature
        Git->>Repo: Read .gitattributes for pixi.lock
        Git->>Git: Apply built in merge=ours
        Git-->>Developer: pixi.lock from current branch kept
    end
Loading

File-Level Changes

Change Details Files
Switch lockfile merge behavior to use Git’s built-in merge=ours instead of a custom merge driver.
  • Define merge=ours behavior for pixi.lock directly in .gitattributes so it takes effect without local Git configuration.
  • Remove any references to the custom ourslock merge driver from repository configuration.
.gitattributes
Remove obsolete tooling for configuring the custom merge driver.
  • Delete the setup-git-merge-driver pixi task that configured the custom driver via git config.
  • Remove the merge-driver setup logic from the .claude/hooks/SessionStart hook so new sessions don’t attempt to configure it.
pyproject.toml
.claude/hooks/SessionStart

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@blooop blooop merged commit baaeac6 into main Mar 1, 2026
7 checks passed
@blooop blooop deleted the feature/mergedriver branch March 1, 2026 16:31
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