git config option color.diff can break diff and commit graph #1379

Closed
opened 2025-11-02 03:58:41 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @haytona on GitHub (Dec 17, 2017).

  • Gitea version (or commit ref): Master and 1.3.1
  • Git version: 2.14.0.windows.2
  • Operating system: Windows Server 2012 R2
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
    n/a

Description

I've just discovered why my gitea wasn't working correctly. I raised a panic issue here yesterday which @bkcsoft submitted a patch for (pull/3156). After pulling down the latest master build that then revealed that I was unable to view any diffs. After scratching my head and walking through the git_diff.go source, I discovered my issue was shared config where I had been trying to improve my command line diffs in ~/.gitconfig but this clashed with gitea's use of git diff. Specifically I'd set color.diff=always in my ~/.gitconfig. Removing this has brought back my diff output and also the commit graph. Potentially gitea could specify --no-color however I think this is a case of user error (Lafriks asked I submit this as an issue from discord chat).

This issue would only affect people running gitea and git with the same user id. I have this in an environment where we are using the windows executable in a portable mode.

Symptoms: Panic, until pull/3156 was merged then a Diff content unavailable message. The commit graph was also missing the visual representation or "train tracks".

Edit: fixed @ mention.

Originally created by @haytona on GitHub (Dec 17, 2017). - Gitea version (or commit ref): Master and 1.3.1 - Git version: 2.14.0.windows.2 - Operating system: Windows Server 2012 R2 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [X] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [X] No - [ ] Not relevant - Log gist: n/a ## Description I've just discovered why my gitea wasn't working correctly. I raised a panic issue here yesterday which @bkcsoft submitted a patch for (pull/3156). After pulling down the latest master build that then revealed that I was unable to view any diffs. After scratching my head and walking through the git_diff.go source, I discovered my issue was shared config where I had been trying to improve my command line diffs in ~/.gitconfig but this clashed with gitea's use of git diff. Specifically I'd set `color.diff=always` in my ~/.gitconfig. Removing this has brought back my diff output and also the commit graph. Potentially gitea could specify `--no-color` however I think this is a case of user error (Lafriks asked I submit this as an issue from discord chat). This issue would only affect people running gitea and git with the same user id. I have this in an environment where we are using the windows executable in a portable mode. Symptoms: Panic, until pull/3156 was merged then a Diff content unavailable message. The commit graph was also missing the visual representation or "train tracks". Edit: fixed @ mention.
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 03:58:41 -06:00
Author
Owner

@bkc commented on GitHub (Dec 17, 2017):

@haytona I think you meant to refer to @bkcsoft on this ticket..

@bkc commented on GitHub (Dec 17, 2017): @haytona I think you meant to refer to @bkcsoft on this ticket..
Author
Owner

@stale[bot] commented on GitHub (Feb 10, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 10, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Feb 24, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Feb 24, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Author
Owner

@wxiaoguang commented on GitHub (Jul 4, 2022):

It should have been fixed in

And the following:

@wxiaoguang commented on GitHub (Jul 4, 2022): It should have been fixed in * https://github.com/go-gitea/gitea/pull/19732 And the following: * https://github.com/go-gitea/gitea/pull/20114
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1379