-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Show git-notes #6984
Show git-notes #6984
Conversation
434c841
to
5b8e243
Compare
Codecov Report
@@ Coverage Diff @@
## master #6984 +/- ##
==========================================
- Coverage 41.49% 41.49% -0.01%
==========================================
Files 440 441 +1
Lines 59459 59507 +48
==========================================
+ Hits 24674 24692 +18
- Misses 31566 31589 +23
- Partials 3219 3226 +7
Continue to review full report at Codecov.
|
Any screenshot? And could you change the text on template to |
I like the idea of this - however, is there any way to avoid reading the whole thing in memory and or making the page too big to render? How about test the size of the note - if it's less than say 5Kb (most notes will be) then read it in otherwise provide a link that that the UI can asynchronously read. You can stick that as an API route and then you can test the note reading infrastructure relatively easy. I think in general we should be more careful around ReadAll and page sizes. |
Although
Done.
Sorry, could you please explain why you think this is necessary? As far as I know, the typical use of git-notes is editable additions to commit messages. The Even though it's possible to create arbitrarily large git notes, it's also possible to create arbitrarily large commit messages. As far as I can see, Gitea will always display the entire commit message, without limiting it, and without providing a view to see it in its entirety. So, it doesn't make sense to me to do this for git notes without also doing it for commit messages, considering that there don't seem to be any pertinent distinctions between the two. |
9a675e4
to
157f709
Compare
Could you display the author and time of the git note? |
I think it's possible, by looking at the last commit in the notes ref history which updated the note's path. Note that it would be more accurate to say that it would be the person who last edited the note, since if you want to add a note to a commit and a note already exists for that commit, you have no choice but to edit the existing note. |
268bb32
to
5002f09
Compare
5002f09
to
a101240
Compare
a101240
to
7542929
Compare
Could this be added in frame together with commit message? |
AFAIK, notes are not signed by gpg so maybe it is better to display them under the signature. |
You certainly can sign the notes (by making signed commits in the notes ref), but that's a completely distinct signature from the commit that the notes are annotating. Edit: You're right, |
This reverts commit c0951fe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR could be improved by :
- Filtering display of big note that could break ui
- Add tests to validate GetNote func
- Displaying that a note exist (like gpg lock) in commit list and a preview on passing over
- I personally would prefer to display notes like GPG. Attached to the commit block to display that it is linked but under GPG (since itsn't verifed by it)
But this lay down some simple bases that works and could be improved later. And since it is not a main feature those changes are not blocking from my point of view. LGTM
7373f70
to
8f937fa
Compare
I think that if we do this, it should also be done for commit messages.
Test added :)
Good idea, I may submit a follow-up PR adding this.
Do you have a mockup of your idea? Would it be essentially as the second screenshot I posted but without the gap between the blocks? |
Yes but that is for an other PR. It could be good to do it directly for notes but that isn't a blocking point (at least for me) as I suppose that people using note will understand and it could be fixed later.
I have done some testing here : sapk-fork@2f453e7 |
Yes I was thinking about something like what @sapk did |
8f937fa
to
b20bf0a
Compare
I like what you did with the header so I adapted that: I am not sure about gluing the note block to the commit block, for two reasons:
Of course you have the final word :) |
@CyberShadow I like what you did in the screenshots, as it will allow showing that notes are GPG signed similar to how commits are (to be done in a future PR of course). |
This looks really nice now |
Those two small suggestions but otherwise looks good |
Co-Authored-By: Lauris BH <lauris@nix.lv>
Thanks for PR ;) |
* Show git-notes * Make git-notes heading text localizable * Refactor git-notes data fetching to a separate function * Display the author and time of git notes * Move note bubble inside the commit bubble * Revert "Move note bubble inside the commit bubble" This reverts commit c0951fe. * Add test for git-notes * testing ui * Polish CSS * Apply suggestions from code review Co-Authored-By: Lauris BH <lauris@nix.lv>
This PR implements basic support for displaying notes created by
git notes
(or software supporting it, such as magit).The notes are read from Git's default ref location (
refs/notes/commits
), and thus it is assumed that the ref is pushed at that location to Gitea.The implementation here is minimal; if the idea is OK, I can do any necessary changes.