Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitGraph support for commit messages #4908

Open
guypursey opened this issue Oct 4, 2023 · 1 comment
Open

GitGraph support for commit messages #4908

guypursey opened this issue Oct 4, 2023 · 1 comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@guypursey
Copy link
Contributor

Proposal

Ability to add commit messages to commits in a GitGraph.

It's already possible for commits in a GitGraph to be augmented with a custom ID, a type, and a tag.

Users might use the custom ID field to act as a commit message instead. However, although it's not officially documented, there is a tacit assumption that commit IDs in the graph should be unique, else commands like cherry-pick do not work.

Commit messages sometimes need to duplicated. IDs in the graph should be unique, but messages should not.

This was picked up in conversation on issue #4838 where duplication of an ID acting as a message caused an error in the rendering of the graph.

(NB. A similar issue exists but I think it's different: issue #3900 asks for annotations. But this would be more like comments overlaid on top of any aspect of the graph, whether they be commits, branch lines, and merge or cherry-pick arrows. This issue is a syntax request for messages directly integrated into the graph.)

Example

By itself:

gitGraph
    commit message: "Commit message"

With custom ID:

gitGraph
    commit id: "A" message: "Commit message"

With custom IDs, tags, and types:

gitGraph
       commit message: "Initial commit"
       commit id: "Normal" tag: "v1.0.0" message: "First major version"
       commit message: "Incremental changes"
       commit id: "Reverse" type: REVERSE tag: "RC_1" message: "Some changes were reverted here"
       commit message: "Incremental changes"
       commit id: "Highlight" type: HIGHLIGHT tag: "8.8.4" message: "Important changes happened here"

Screenshots

A rough idea of what this could look like:

image

Suggestions:

  • Truncating the message at 50 characters regardless of length, in keeping with common practice would make this easier to implement.
  • Using a monospaced font in keeping with the CLI aesthetic might also make rendering considerations easier.
  • A different background to the commit ID (or no background) would help tell the ID and message apart.
@guypursey guypursey added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Oct 4, 2023
@mr-loop-1
Copy link

mr-loop-1 commented Oct 9, 2023

Hi @guypursey , I would like to work on this when it gets through Triage.

@jgreywolf jgreywolf added include and removed include labels Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants