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

Add Notes column. #11417

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pmgiant
Copy link
Contributor

@pmgiant pmgiant commented Nov 30, 2023

I need to see git notes in a separate column of RevisionGridControl. My notes are usually short and often re-generated by scripts.

The only initially visible change is a new menu item: View / Show git notes column.
Checking it adds a new column to the revision grid, between "Message" and "Avatar".
This column displays the first row of a note.
Notes displayed by CommitDataBodyRenderer (Commit tab of the "Commit info" pane) and MessageColumnProvider remain unaffected.

Checking either one of the "Show notes..." menu items enables note loading. Checking only the old menu item "Show notes" also shows notes ref. Checking only the "Show notes column" item leads to displaynig notes text in columns and commit info, but hiding notes "ref".

I`ve simplified the code a bit, now the CommitData and GitRevision classes have separate members for "Body" and "Notes". Parsing/re-formatting logic has been adjusted accordingly, code duplicates were not fixed in order to minimise footprint.
This change probably also fixes some potential bugs, as the notes are no longer part of the content of the message body internally.

~Fixes #11413

Proposed changes

Screenshots

Before

Originally without the column (menu item un-checked).

image

After

Feature turned on, notes not displayed in MessageColumn, but in the separate one.
Either case, the notes are displayed in the "commit info" html pane, there`s plenty of space there.

image

Test methodology

Test environment(s)

  • GIT
  • Windows

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@ghost ghost assigned pmgiant Nov 30, 2023
@RussKie RussKie marked this pull request as draft December 1, 2023 02:07
@RussKie
Copy link
Member

RussKie commented Dec 1, 2023

Could you please provide screenshots as well?

@pmiossec
Copy link
Member

pmiossec commented Dec 1, 2023

You have build issue to fix: https://ci.appveyor.com/project/gitextensions/gitextensions/builds/48652155

First, I like the idea. It cool make the git note feature really useful whereas at the moment I never really used it...

But I wonder if it's not a setting I would like to enable per repository. Because some repos will have notes but some other not. And I don't want to have to spend all my time to enable/disable it every times when switching between repos. Except if the size is automatically set to 0 if there is none displayed.

@pmgiant
Copy link
Contributor Author

pmgiant commented Dec 1, 2023

Thanks, sure thing, different code styles...

Perhaps it can be done, I`m new to the codebase, so parts of the change were done quickly, the copy-pase way. Perhaps the appSetting global parameter is not the way to go. Maybe someone could point me to the per-repository settings mechanism :) ?

@pmiossec
Copy link
Member

pmiossec commented Dec 1, 2023

Perhaps it can be done, I`m new to the codebase, so parts of the change were done quickly, the copy-pase way. Perhaps the appSetting global parameter is not the way to go. Maybe someone could point me to the per-repository settings mechanism :) ?

Hold on! It's not an order to do so 🤣 I would like to start a discussion on the subject. We will see others point of view...

@vbjay
Copy link
Contributor

vbjay commented Dec 1, 2023

But I wonder if it's not a setting I would like to enable per repository. Because some repos will have notes but some other not. And I don't want to have to spend all my time to enable/disable it every times when switching between repos. Except if the size is automatically set to 0 if there is none displayed.

Just like build server config, allow scoped setting. Global, distributed with repo, local repo. That way the user can set a default in global and if a specific repo should have it then setting in distributed/local can override the global setting.

@pmiossec
Copy link
Member

pmiossec commented Dec 1, 2023

But I wonder if it's not a setting I would like to enable per repository. Because some repos will have notes but some other not. And I don't want to have to spend all my time to enable/disable it every times when switching between repos. Except if the size is automatically set to 0 if there is none displayed.

Just like build server config, allow scoped setting. Global, distributed with repo, local repo. That way the user can set a default in global and if a specific repo should have it then setting in distributed/local can override the global setting.

Yes, that's what I was thinking. But that means that no more menuitem in the View menu but more here maybe:

image

@pmgiant pmgiant force-pushed the feature/addNotesColumn branch 2 times, most recently from 7146d0f to 787e9b1 Compare December 1, 2023 14:10
@pmiossec
Copy link
Member

pmiossec commented Dec 1, 2023

@pmgiant to fix the build, run the script update-loc.cmd that you will find at the repository root folder.

@pmgiant
Copy link
Contributor Author

pmgiant commented Dec 1, 2023

I have a question - I`ve been working with the debug build of gitExtensions for some time now. Everything is fine, except for one thing - there are numerous quite suspicious assserts failing from time to time. Shall I report them as issues?

@vbjay
Copy link
Contributor

vbjay commented Dec 1, 2023

But I wonder if it's not a setting I would like to enable per repository. Because some repos will have notes but some other not. And I don't want to have to spend all my time to enable/disable it every times when switching between repos. Except if the size is automatically set to 0 if there is none displayed.

Just like build server config, allow scoped setting. Global, distributed with repo, local repo. That way the user can set a default in global and if a specific repo should have it then setting in distributed/local can override the global setting.

Yes, that's what I was thinking. But that means that no more menuitem in the View menu but more here maybe:

image

Menu is possible with a sub menu of which scope.

@pmgiant pmgiant force-pushed the feature/addNotesColumn branch 6 times, most recently from 91e5af8 to 9e66264 Compare December 2, 2023 14:54
@pmgiant pmgiant marked this pull request as ready for review December 2, 2023 15:14
@gerhardol
Copy link
Member

Perhaps it can be done, I`m new to the codebase, so parts of the change were done quickly, the copy-pase way. Perhaps the appSetting global parameter is not the way to go. Maybe someone could point me to the per-repository settings mechanism :) ?

Hold on! It's not an order to do so 🤣 I would like to start a discussion on the subject. We will see others point of view...

I am not convinced that is needed. It is only a column visible or not.
(appsetting can be global/repo etc too)

Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

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

Mostly fine.

GitCommands/RevisionReader.cs Outdated Show resolved Hide resolved
Plugins/GitUIPluginInterfaces/GitRevision.cs Outdated Show resolved Hide resolved
Plugins/GitUIPluginInterfaces/GitRevision.cs Outdated Show resolved Hide resolved
GitCommands/Settings/AppSettings.cs Outdated Show resolved Hide resolved
GitCommands/Settings/AppSettings.cs Outdated Show resolved Hide resolved
GitCommands/CommitDataManager.cs Outdated Show resolved Hide resolved
GitCommands/CommitDataManager.cs Outdated Show resolved Hide resolved
Plugins/GitUIPluginInterfaces/GitRevision.cs Outdated Show resolved Hide resolved
@RussKie RussKie added the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Dec 3, 2023
@ghost ghost removed the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Dec 3, 2023
Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

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

just refinement

GitCommands/CommitDataManager.cs Outdated Show resolved Hide resolved
GitCommands/CommitDataManager.cs Outdated Show resolved Hide resolved
GitCommands/CommitDataManager.cs Outdated Show resolved Hide resolved
GitCommands/CommitDataManager.cs Show resolved Hide resolved
GitCommands/RevisionReader.cs Show resolved Hide resolved
GitUI/Translation/English.xlf Show resolved Hide resolved
Plugins/GitUIPluginInterfaces/GitRevision.cs Outdated Show resolved Hide resolved
Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

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

in addition to the remaining not yet resolved comments

Please avoid unnecessary force-pushes in order to ease incremental reviews. "Fixup!" commits will be squashed right before or on merge.

GitCommands/CommitDataManager.cs Outdated Show resolved Hide resolved
GitCommands/CommitDataManager.cs Outdated Show resolved Hide resolved
@RussKie RussKie added the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Dec 24, 2023
@ghost ghost added the 💤 status: no recent activity The issue is stale label Jan 7, 2024
@ghost
Copy link

ghost commented Jan 7, 2024

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days. It will be closed if no further activity occurs.

@ghost ghost removed 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity 💤 status: no recent activity The issue is stale labels Jan 8, 2024
@pmgiant
Copy link
Contributor Author

pmgiant commented Jan 9, 2024

As suggested above by "mstv", I created a new "fixup!..." commit instead of squashing consecutive tiny code refactorings. Now the "block-fixup" check fails.

@pmiossec
Copy link
Member

pmiossec commented Jan 9, 2024

As suggested above by "mstv", I created a new "fixup!..." commit instead of squashing consecutive tiny code refactorings. Now the "block-fixup" check fails.

fixup are intended to be temporary to make review easier and to be squash just before merging the PR (so that the check pass).

@mstv mstv self-requested a review January 9, 2024 11:41
@RussKie
Copy link
Member

RussKie commented Jan 9, 2024 via email

@pmgiant
Copy link
Contributor Author

pmgiant commented Jan 9, 2024

So maybe let's wait for a day od two, if someone wants to take a look at these few last (hopefully) polishes.
If no one wants to add any more comments - I'll squash these two commits into a single, concise change.

GitCommands/CommitDataManager.cs Outdated Show resolved Hide resolved
GitCommands/CommitDataManager.cs Outdated Show resolved Hide resolved
GitCommands/Settings/AppSettings.cs Outdated Show resolved Hide resolved
GitExtUtils/GitUI/UIExtensions.cs Outdated Show resolved Hide resolved
GitUI/CommandsDialogs/FormBrowse.cs Outdated Show resolved Hide resolved
Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

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

unfinished refinement

GitUI/CommandsDialogs/FormBrowse.cs Outdated Show resolved Hide resolved
GitUI/CommitInfo/CommitInfo.cs Outdated Show resolved Hide resolved
GitExtUtils/GitUI/UIExtensions.cs Outdated Show resolved Hide resolved
@pmgiant
Copy link
Contributor Author

pmgiant commented Jan 10, 2024

@mstv, I don't get the 'exclamation mark' comments above about UIExtensions.cs:64 and FormBrowse.cs:663.

@mstv
Copy link
Member

mstv commented Jan 10, 2024

I don't get the 'exclamation mark' comments above about UIExtensions.cs:64 and FormBrowse.cs:663.

Several comments of my first review have not been addressed at all: refer to #11417 (review) (might need to load comments hidden by GH).

@pmgiant
Copy link
Contributor Author

pmgiant commented Jan 10, 2024

All items have been adressed there, as far as I can count to 14 and refresh a web page late in the night.. :)

@mstv
Copy link
Member

mstv commented Jan 11, 2024

Several comments of my first review have not been addressed at all

All items have been adressed there, as far as I can count to 14 and refresh a web page late in the night.. :)

might need to load comments hidden by GH

#11417 (comment)
#11417 (comment)
#11417 (comment)

GitExtUtils/GitUI/UIExtensions.cs Outdated Show resolved Hide resolved
GitExtUtils/GitUI/UIExtensions.cs Show resolved Hide resolved
Plugins/GitUIPluginInterfaces/GitRevision.cs Outdated Show resolved Hide resolved
Plugins/GitUIPluginInterfaces/GitRevision.cs Outdated Show resolved Hide resolved
Plugins/GitUIPluginInterfaces/CommitData.cs Show resolved Hide resolved
@pmgiant
Copy link
Contributor Author

pmgiant commented Jan 12, 2024

Weird, some reviews expanded by default were displayed somewhat incomplete and read-only. Their commentable counterparts could be found after some scrolling and expanding.
For now they all look addressed properly :)

Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

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

have not run

@mstv
Copy link
Member

mstv commented Jan 12, 2024

English.xlf needs to be updated or the ampersand for the menu item to be restored - as you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate column for Notes (already coded)
6 participants