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

Cherry-pick shows as merge, even though there was no merge involved #5540

Open
TWiStErRob opened this issue May 24, 2024 · 3 comments
Open
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@TWiStErRob
Copy link
Contributor

TWiStErRob commented May 24, 2024

Description

When we cherry-pick a (non-merge) commit in git there's no relation between the original branch, it just copies over the commit and re-applies on current HEAD. For this reason the line between the original commit and the cherry-picked one shouldn't look like a merge.

Steps to reproduce

gitGraph
    commit
    commit
    branch feature
    commit
    commit
    checkout main
    commit
    commit id: "to-pick"
    checkout feature
    commit
    cherry-pick id: "to-pick"
    commit
    checkout main
    commit
    merge feature
    commit
    commit
Loading
gitGraph
    commit
    commit
    branch feature
    commit
    commit
    checkout main
    commit
    commit id: "to-pick"
    checkout feature
    commit
    merge main
    commit
    checkout main
    commit
    merge feature
    commit
    commit
Loading

Screenshots

image

Code Sample

```mermaid
gitGraph
    commit
    commit
    branch feature
    commit
    commit
    checkout main
    commit
    commit id: "to-pick"
    checkout feature
    commit
    cherry-pick id: "to-pick"
    commit
    checkout main
    commit
    merge feature
    commit
    commit
```

```mermaid
gitGraph
    commit
    commit
    branch feature
    commit
    commit
    checkout main
    commit
    commit id: "to-pick"
    checkout feature
    commit
    merge main
    commit
    checkout main
    commit
    merge feature
    commit
    commit
```

Setup

  • Mermaid version: any before 11.0.0 alpha 07
  • Browser and Version: Chrome 124

Suggested Solutions

No line, or a different line, like a straight one, or a thinner one.

Additional Context

No response

@TWiStErRob TWiStErRob added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels May 24, 2024
@Alizah143
Copy link

Delete the branch where Cherry-pick shows it may work

@TWiStErRob
Copy link
Contributor Author

Can you please clarify @AminaRahim23 ? Or grab the code from sample and show what you mean?

@Alizah143
Copy link

Screenshot 2024-06-05 125356
let me tell u whenever HEAD is showing ofc this means that u are in this branch or even id if cherry-pick is showing many it may caused by mistake if its in another branch delete the branch "git branch --delete " if this is done it may will not show but even if it does then u should "git reset --hard HEAD~1" or u can try to give any number u want to shift your HEAD just try this if it didn't worked let me know i am still here:-)

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: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

2 participants