Skip to content

feat(stack): add 'mergify stack note' command#1267

Merged
mergify[bot] merged 1 commit intomainfrom
devs/jd/worktree-git-notes/add-mergify-stack-note-cmd--33cc921f
Apr 21, 2026
Merged

feat(stack): add 'mergify stack note' command#1267
mergify[bot] merged 1 commit intomainfrom
devs/jd/worktree-git-notes/add-mergify-stack-note-cmd--33cc921f

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented Apr 20, 2026

Attach free-text "why was this commit amended" notes to commits. Notes
live in refs/notes/mergify/stack, a dedicated leaf under the
refs/notes/mergify/ namespace (sibling to the MQ note refs). mergify stack setup appends refs/notes/mergify/* to notes.displayRef so plain
git log shows all mergify notes (both stack and MQ) automatically.

Usage:

mergify stack note [-m MESSAGE] [--append] [--remove] [COMMIT]

  • COMMIT defaults to HEAD; accepts SHA prefix or Change-Id prefix.
  • -m MESSAGE attaches the note inline; without it, $GIT_EDITOR opens
    with a template where comment lines (starting with #) are stripped.
  • --append concatenates to an existing note.
  • --remove deletes the note (idempotent).

This is the first of two PRs for the stack-notes feature. This PR adds
the command surface and local visibility via git log. A follow-up PR
pushes the notes ref to the remote and surfaces the reasons in the
revision-history PR comment.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Copilot AI review requested due to automatic review settings April 20, 2026 14:24
@jd
Copy link
Copy Markdown
Member Author

jd commented Apr 20, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(stack): add 'mergify stack note' command #1267 👈
2 feat(stack): push notes and surface reasons in revision history #1268

@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 20, 2026 14:24 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 20, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

Copy link
Copy Markdown

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

Adds a new mergify stack note command to attach free-text “why was this commit amended” notes to commits via git-notes, and updates stack setup to make those notes visible in plain git log by configuring notes.displayRef.

Changes:

  • Introduce mergify stack note command and implementation for add/append/remove + editor fallback.
  • Update stack setup to configure notes.displayRef for Mergify notes visibility.
  • Add/adjust tests for the new command and setup behavior; update README command list.

Reviewed changes

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

Show a summary per file
File Description
mergify_cli/stack/note.py New git-notes based “stack note” implementation (add/append/remove, editor flow).
mergify_cli/stack/cli.py Wire new stack note command into Click CLI.
mergify_cli/stack/setup.py Configure notes.displayRef during stack setup.
mergify_cli/tests/stack/test_note.py New end-to-end style tests for note behavior.
mergify_cli/tests/stack/test_setup.py Extend setup tests to cover/handle notes.displayRef configuration.
README.md Document the new command in the command table.

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

Comment thread mergify_cli/stack/setup.py Outdated
Comment thread mergify_cli/stack/note.py Outdated
Comment thread mergify_cli/stack/note.py Outdated
Comment thread mergify_cli/stack/cli.py
Comment thread mergify_cli/stack/note.py
@jd jd marked this pull request as ready for review April 20, 2026 14:58
Attach free-text "why was this commit amended" notes to commits. Notes
live in refs/notes/mergify/stack, a dedicated leaf under the
refs/notes/mergify/ namespace (sibling to the MQ note refs). `mergify
stack setup` appends refs/notes/mergify/* to notes.displayRef so plain
`git log` shows all mergify notes (both stack and MQ) automatically.

Usage:

  mergify stack note [-m MESSAGE] [--append] [--remove] [COMMIT]

- COMMIT defaults to HEAD; accepts SHA prefix or Change-Id prefix.
- -m MESSAGE attaches the note inline; without it, $GIT_EDITOR opens
  with a template where comment lines (starting with #) are stripped.
- --append concatenates to an existing note.
- --remove deletes the note (idempotent).

This is the first of two PRs for the stack-notes feature. This PR adds
the command surface and local visibility via `git log`. A follow-up PR
pushes the notes ref to the remote and surfaces the reasons in the
revision-history PR comment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Change-Id: I33cc921fb2caac6a31d2284b2ef76d0429b510ef
@jd jd force-pushed the devs/jd/worktree-git-notes/add-mergify-stack-note-cmd--33cc921f branch from 6932dd2 to b188fe3 Compare April 20, 2026 15:09
@jd
Copy link
Copy Markdown
Member Author

jd commented Apr 20, 2026

Revision history

# Type Changes Reason Date
1 initial 6932dd2 2026-04-20 15:09 UTC
2 content 6932dd2 → b188fe3 2026-04-20 15:09 UTC

@mergify mergify Bot deployed to Mergify Merge Protections April 20, 2026 15:10 Active
@mergify mergify Bot requested a review from a team April 20, 2026 15:14
@mergify mergify Bot requested a review from a team April 21, 2026 07:15
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 21, 2026

Merge Queue Status

This pull request spent 5 minutes 32 seconds in the queue, including 5 minutes 5 seconds running CI.

Required conditions to merge

mergify Bot added a commit that referenced this pull request Apr 21, 2026
@mergify mergify Bot added the queued label Apr 21, 2026
mergify Bot added a commit that referenced this pull request Apr 21, 2026
mergify Bot added a commit that referenced this pull request Apr 21, 2026
@mergify mergify Bot merged commit 28a4a1b into main Apr 21, 2026
19 checks passed
@mergify mergify Bot deleted the devs/jd/worktree-git-notes/add-mergify-stack-note-cmd--33cc921f branch April 21, 2026 07:42
@mergify mergify Bot removed the queued label Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants