Skip to content

Conversation

@brymut
Copy link
Contributor

@brymut brymut commented Nov 7, 2025

Resolves #4898
/claim #4898

Added ability to add inline comments on commit diffs. Using new commit_comment table and re-using the existing comment template and other existing functionality eg. Attachments & reactions.

Demo:

Screen.Recording.2025-11-07.at.17.44.35.mov

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 7, 2025
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/migrations modifies/frontend labels Nov 7, 2025
@brymut brymut marked this pull request as ready for review November 7, 2025 14:47
@brymut brymut force-pushed the feat-add-commit-comments branch from ced02fa to 79eb8ac Compare November 7, 2025 15:13
@lunny
Copy link
Member

lunny commented Nov 7, 2025

It also have the same problem as #32257 when the comments in the hidden lines.

// CommitComment represents a comment on a specific line in a commit diff
type CommitComment struct {
ID int64 `xorm:"pk autoincr"`
RepoID int64 `xorm:"INDEX"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can have a reply_id?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not only one or two fields, the table's design overall doesn't seem right. I have explained in discord.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Nov 8, 2025

It also have the same problem as #32257 when the comments in the hidden lines.

One more thing: "Add inline comments on commits #4898" requests the feature for "commits", but not for "commit diffs"


By the way, I don't quite understand why this feature is that important or how end users can really use it, also quote my discord question:

I don't understand why that feature can be useful. For a repo with thousands of commits, a "commit comment" can be easily lost. For example, I also ever left some commit comments on GitHub, then I can never found them and I think there is no progress of them. So I don't know what it should look like or how to make it right.

And many voices in #4898 are talking about "comment on files directly (for student, education #4898 (comment))", not really "per commit".

Overall I don't see real use cases for such "commit level comments"

@wxiaoguang wxiaoguang marked this pull request as draft November 8, 2025 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🙋 Bounty claim lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/frontend modifies/go Pull requests that update Go code modifies/migrations modifies/templates This PR modifies the template files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add inline comments on commits

4 participants