commitgraph throws err 500 when commit message contains a pipe #466

Closed
opened 2025-11-02 03:24:25 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @philfry on GitHub (Mar 10, 2017).

[...uters/repo/commit.go:92 Graph()] [E] GetCommitGraph: Failed parsing grap line:* DATA:||... - Should containt 8 datafields

Description

steps to reproduce:

touch dummyfile
git add dummyfile
git commit -m "this is a testcommit | containing a pipe"
git push
# view commitgraph

In models/graph.go in GetCommitGraph(r *git.Repository) (GraphItems, error) calls a git log and uses a custom format using pipes as field separators. Later in graphItemFromString(s string, r *git.Repository) (GraphItem, error) the lines get split by that delimiter and the resulting array is being checked whether or not it has exactly 8 elements.
The easiest solution would be to check whether or not the array has at least 8 elements and merge the 8th to nth elements together.

Originally created by @philfry on GitHub (Mar 10, 2017). - Gitea version (or commit ref): 1.1.0+5-gdbcd4527 - Git version: 2.12.0 - Operating system: Linux/CentOS7 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes: https://try.gitea.io/philtry/commitgraphtest/graph - [ ] No - [ ] Not relevant - Log gist: ``` [...uters/repo/commit.go:92 Graph()] [E] GetCommitGraph: Failed parsing grap line:* DATA:||... - Should containt 8 datafields ``` ## Description steps to reproduce: ``` touch dummyfile git add dummyfile git commit -m "this is a testcommit | containing a pipe" git push # view commitgraph ``` In `models/graph.go` in `GetCommitGraph(r *git.Repository) (GraphItems, error)` calls a `git log` and uses a custom format using pipes as field separators. Later in `graphItemFromString(s string, r *git.Repository) (GraphItem, error)` the lines get split by that delimiter and the resulting array is being checked whether or not it has exactly 8 elements. The easiest solution would be to check whether or not the array has **at least** 8 elements and merge the 8th to nth elements together.
GiteaMirror added the type/bug label 2025-11-02 03:24:25 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#466