Skip to content

feat(merman): support cherry-pick in GitGraph diagrams - #42241

Open
Robin1987China wants to merge 1 commit into
anomalyco:v2from
Robin1987China:gitgraph-cherry-pick
Open

feat(merman): support cherry-pick in GitGraph diagrams#42241
Robin1987China wants to merge 1 commit into
anomalyco:v2from
Robin1987China:gitgraph-cherry-pick

Conversation

@Robin1987China

Copy link
Copy Markdown
Contributor

Issue for this PR

N/A — feat PR (feature PRs skip issue requirement per contributing guidelines)

Type of change

  • New feature

What does this PR do?

Completes the GitGraph feature landed in #42179: the parser currently rejects cherry-pick with "Cherry-pick is not supported". This PR implements cherry-pick per Mermaid semantics:

  • cherry-pick id: "c1" (optional tag: override) appends a cherry-picked commit to the current branch, inheriting the source commit's message and tags
  • The source commit must already exist in the diagram; unknown references fail with a source diagnostic
  • Cherry-picked commits use a generated id (so the commitById render map stays unambiguous) and render with a hollow glyph in a dedicated cherry cell style, echoing Mermaid's dashed-circle representation

How did you verify your code works?

  • Added tests in packages/merman/src/gitgraph/diagram.test.ts: parse + inherited message/tags + tag override, missing-id and unknown-reference errors, hollow-glyph rendering
  • Updated the two pre-existing assertions that expected the "not supported" error
  • bun test (packages/merman) — 327 pass
  • tsgo --noEmit (packages/merman) — clean

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant