Skip to content

Git Graph fails to load when a commit message contains a raw CR character #935

Open

Description

@HaoranZHENG-Vortex

Problem

Git Graph fails to finish loading when a commit message contains a raw carriage return (CR, byte 0x0D) in the commit subject.

Reproduction

Create a commit message containing a raw CR character:

printf '%s\r%s\n' \\
	'Test commit message with ' \\
	'a raw CR character' > /tmp/commit-message.txt

git add <file>
git commit -F /tmp/commit-message.txt

The commit object can be checked for byte 0x0D with:

git cat-file commit HEAD | sed '1,/^$/d' | od -An -tx1c

Actual behavior

The graph or branch list remains stuck while loading when the commit is included in the displayed history. Other commits may load normally when the problematic commit is not included.

Expected behavior

Git Graph should continue loading and display the commit graph. A raw CR in a commit message should be safely handled, escaped, or reported without blocking the graph.

Technical detail

A raw CR byte (0x0D) is different from the two-character sequence \\r and from a normal line-feed (LF, byte 0x0A). When rendered by a terminal or log viewer, it can return the cursor to the beginning of the current line and overwrite or merge displayed text.

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

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions