Skip to content

Diagram on "About pull request merges" is misleading and confusing #21507

@IMSoP

Description

@IMSoP

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges

What part(s) of the article would you like to see updated?

The first diagram, showing a non-fast-forward merge, is extremely misleading, because it appears to show commits as "living on" a branch, and somehow "moving between them" when they are merged.

Most glaringly, the last line appears to show commit D no longer having any ancestors, when in reality it will still trace history back to commit C, and this is a very important feature of git.

It is also confusing that the label "Main" appears twice, leaving the reader to guess that one is before and one after the merge.

Current diagram in ASCII art for comparison:

Main: A -> B -> C
Feature: A -> B -> C -> D -> E
Main: A -> B -> C ----> F
                    /
              D -> E

Suggested replacement:

Before: A -> B -> C <-(main)
                  \
                   +-> D -> E <-(feature)

After: A -> B -> C -----------> F <-(main)
                  \          /
                   +-> D -> E <-(feature)

The second diagram, showing a squash merge, could be updated to match (where ~~~~~ represents the triangle of arrows linking D + E to F on the existing diagram):

Before: A -> B -> C <-(main)
                  \
                   +-> D -> E <-(feature)

After: A -> B -> C ----> F    <-(main)
                  \    ~~~~~~
                   +-> D -> E <-(feature)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content teampull requestsContent related to pull requestswaiting for reviewIssue/PR is waiting for a writer's review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions