Skip to content

[luv-71] fix: Stop hook should skip when branch has no changes vs base #70

@NiveditJain

Description

@NiveditJain

Problem

The Stop hook currently requires a pushed branch and an open PR even when the branch has zero commits ahead of main. This forces unnecessary empty commits and dummy PRs just to satisfy the hook.

Reproduction

  1. Create a branch from main with no code changes (e.g. a release-only task)
  2. Try to stop the session
  3. Hook fails with:
    • fatal: Needed a single revision (branch not pushed)
    • No pull request found for branch (no PR exists)

Expected behavior

The Stop hook should detect that the branch has no diff vs the base branch and skip the push/PR requirement — similar to how require-pr-before-stop already handles the no-changes case in #67.

Current workaround

Create an empty commit and a dummy PR to satisfy the hook.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions