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

Fix rendering of git commits with bodies in the History Inspector #1742

Merged

Conversation

simonwhitaker
Copy link
Contributor

@simonwhitaker simonwhitaker commented Jun 2, 2024

Description

GitClient's getCommitHistory method fetches git history by executing git log, with a format string that can render multi-line content for a commit, then parses the string into individual commits by splitting on newline. This approach breaks when multi-line content is encountered.

In this PR, I pass -z to git log, so that entries are terminated with a null byte instead of a newline, then when parsing the content, split on \0 instead of \n.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Before:

CleanShot 2024-06-02 at 10  12 52@2x

After:

CleanShot 2024-06-02 at 10  21 30@2x

@bombardier200 bombardier200 merged commit 0783f70 into CodeEditApp:main Jun 3, 2024
2 checks passed
@austincondiff
Copy link
Collaborator

@allcontributors add @simonwhitaker for bug

Copy link
Contributor

@austincondiff

I've put up a pull request to add @simonwhitaker! 🎉

@simonwhitaker simonwhitaker deleted the fix-git-commit-body-rendering branch June 3, 2024 14:00
@thecoolwinter thecoolwinter added the bug Something isn't working label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐞 Ghost entries in the History Inspector view
5 participants