mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown

Home Page:https://mermaid.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tag a commit separate from the line defining the commit in gitGraph

ketozhang opened this issue · comments

Proposal

In git, you can tag the HEAD (current commit).

In mermaid, tagging can only be done as part of commit. This creates an awkward syntax forcing tagging to happen on a non-release branch (e.g., dev or feature branch) when in reality most tag on the release or default branch (e.g., main)

Example

Desired syntax:

gitGraph
  commit
  commit

  branch dev
  commit
  commit id: "abcdef"

  checkout main
  merge dev
  tag "v1.0.0"  %% optionally you may add id: "abcdef"

Expected Output
Similar to this, but ideally the tag should be placed on the merge node (open circle).

gitGraph
  commit
  commit
  
  branch dev
  commit
  commit id: "abcdef" tag: "v1.0.0"
  
  checkout main
  merge dev

Screenshots

No response

This is already accomodated using merge tags (#3361)

gitGraph
  commit
  commit

  branch dev
  commit
  commit id: "abcdef"

  checkout main
  merge dev tag: "v1.0.0"
gitGraph
  commit
  commit

  branch dev
  commit
  commit id: "abcdef"

  checkout main
  merge dev tag: "v1.0.0"

This solves my use case, but having tag as a declarative action might still be useful for other use cases. Closing... Others should request to reopen with their use cases.