-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expose git-grep in settings and context menu #11858
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
Conversation
Git grep searchbox was somehow hidden on your request, you found it confusing. You can enable the searchbox in the popup, not much in the help though... I do not oppose a more direct configuration of the searchbox, but the names are not aligned. Search commit could be renamed too, maybe git-grep should be mentioned at least. I do not |
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.
Is this really needed if the popup is the primary way to use git-grep?
My 2ct:
|
Fine for me |
I wasn't sure on the wording we wanted to use; this is a good suggestion.
The reason I added it was without it a user has to open the popup to enable/disable the git-grep search box. That's not a good UX.
I believe there is - the popup allows to specify additional git-grep option, whilst the search box doesn't.
Yes, I remember that, and I still think having two of those visible by default isn't great. But needing to open another dialog just to show the search box is equally not a good UX. |
|
My keyboard doesn't have a dedicated button, though I think I saw such keyboards.
:-O |
I rather use SearchCommit or "SearchCommit (git-grep)" in UI and SearchCommitGitGrep in code. The search box was considered to be an advanced usage (but I use it daily) why the RevDiff context menu may be redundant. But it can stay if the name is aligned with the invocation of the popup. |
|
||
private void EnableSearchForList(bool enable) | ||
public void ToggleGitGrepSearch(bool visible) |
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.
Toggle is not a good name, it updates the status at every update.
I have some doubts for some of the changes, not time to investigate today....
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.
it updates the status at every update.
Which "status" are you talking about?
Sounds good, I'll change |
My preference is still |
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.
+1 One question on the fuctionality and suggestion to change UI text slightly, otherwise fine.
Updated |
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.
showSearchCommitGitGrepDialogToolStripMenuItem.Image = Properties.Images.ViewFile; | ||
showSearchCommitGitGrepDialogToolStripMenuItem.Name = "showSearchCommitGitGrepDialogToolStripMenuItem"; | ||
showSearchCommitGitGrepDialogToolStripMenuItem.Size = new Size(262, 22); | ||
showSearchCommitGitGrepDialogToolStripMenuItem.Text = "Search commit files with git-grep..."; |
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 function does not "find files" but "searches for text in files of the commit's tree".
That's why we agreed to "search files in commit" in the initial PR.
showSearchCommitGitGrepDialogToolStripMenuItem.Text = "Search commit files with git-grep..."; | |
showSearchCommitGitGrepDialogToolStripMenuItem.Text = "Sear&ch files in commit with git-grep..."; |
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.
I think "Search commit (git-grep)" is fine too, slightly shorter.
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.
In general, I completely disagree with the chosen wording.
We have an existing form and wording for searching in files:
I was aligning the wording with that to provide consistent UX. Now, we have "File file.." and "Search files..." - what's the difference? Both search content in commit files. Different algorithms, but ultimately the same operation - search in files.
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.
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.
I was aligning the wording with that to provide consistent UX. Now, we have "File file.." and "Search files..." - what's the difference? Both search content in commit files. Different algorithms, but ultimately the same operation - search in files.
Find is searching the files in the diff
Search commit is searching the files in the commit
It is really the existing Find that is different from "search in working directory" for search-all apps.
But changing functionality may confuse users. Maybe that test should be changed though.
regardless, I want commit in the label to differentiate this addition. "Find files in commit (git-grep)" is longer than "Search commit (git-grep)". (having git-grep in the label is a bonus)
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.
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.
I would like to have commit in the name
Find file is not a fileter (it would be if in the file-tree)
So the highlighted names (similar for popup), my suggestions
Find in files for commit (git-grep) with regular expression
Find in files for commit (git-grep)...
Show 'Find in files for commit (git-grep)' box
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.
@gerhardol sounds good.
@mstv would it work for you?
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.
Yes, this will work for me.
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.
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.
I buy the wording.
showFindInCommitFilesGitGrepFilterToolStripMenuItem.CheckOnClick = true; | ||
showFindInCommitFilesGitGrepFilterToolStripMenuItem.Name = "showFindInCommitFilesGitGrepFilterToolStripMenuItem"; | ||
showFindInCommitFilesGitGrepFilterToolStripMenuItem.Size = new Size(262, 22); | ||
showFindInCommitFilesGitGrepFilterToolStripMenuItem.Text = "Show 'Filter files using git-grep regular expression'"; |
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.
showFindInCommitFilesGitGrepFilterToolStripMenuItem.Text = "Show 'Filter files using git-grep regular expression'"; | |
showFindInCommitFilesGitGrepFilterToolStripMenuItem.Text = "Show 'Fi<er files using git-grep regular expression'"; |
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.
Show 'Find files in commit using git-grep regular expression'";
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.
No, calling it "Find files.." makes it inconsistent both visually and conceptually.
Both controls have consistent wording:
And conceptually both of these controls filter the list of files - one filters by file name and the other filters by content. By both perform the same kind of operation - filter the list of files.
Also, there's a semantical difference between "find" and "filter". The latter reduces a given list based on criteria, whilst the former locates requested items. And this control is about reducing the list of commit files in the UI based on a search string.
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.
🤔 Perhaps the watermark in the second control should be reworded to "Filter files by name using regul...."
src/app/GitUI/CommandsDialogs/SettingsDialog/Pages/FormBrowseRepoSettingsPage.Designer.cs
Outdated
Show resolved
Hide resolved
@@ -3,12 +3,12 @@ | |||
|
|||
namespace GitUI | |||
{ | |||
partial class FormSearchCommit | |||
partial class FormFindInCommitFilesGitGrep |
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.
"Find" is missing in the file name.
Though as we use "git-grep" in the UI, it should suffice to use just "GitGrep" internally, i.e.
partial class FormFindInCommitFilesGitGrep | |
partial class FormGitGrep |
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.
Similar reasoning as in #11858 (comment) - this rename won't add any value but will increase inconsistency, which will make it harder to build a mental picture when working with the codebase.
private Rectangle _dragBoxFromMouseDown; | ||
private IDisposable? _selectedIndexChangeSubscription; | ||
private IDisposable? _diffListSortSubscription; | ||
private FormSearchCommit _formSearchCommit; | ||
private FormFindInCommitFilesGitGrep _formFindFileGitGrepCommit; |
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.
private FormFindInCommitFilesGitGrep _formFindFileGitGrepCommit; | |
private FormFindInCommitFilesGitGrep _formGitGrep; |
showFindInCommitFilesGitGrepFilterToolStripMenuItem.CheckOnClick = true; | ||
showFindInCommitFilesGitGrepFilterToolStripMenuItem.Name = "showFindInCommitFilesGitGrepFilterToolStripMenuItem"; | ||
showFindInCommitFilesGitGrepFilterToolStripMenuItem.Size = new Size(262, 22); | ||
showFindInCommitFilesGitGrepFilterToolStripMenuItem.Text = "Show 'Filter files using git-grep regular expression'"; |
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.
Show 'Find files in commit using git-grep regular expression'";
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.
Pushed an update, aligning the names
FindInCommitFilesGitGrep in names (not Using)
Find in commit files using git-grep in texts
It would had been easier if we aligned on names before the changes (even better when handling the PR, but that will not always happen).
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.
src/app/GitUI/CommandsDialogs/SettingsDialog/Pages/FormBrowseRepoSettingsPage.Designer.cs
Outdated
Show resolved
Hide resolved
// | ||
AcceptButton = btnSearch; | ||
AutoScaleDimensions = new SizeF(96F, 96F); | ||
AutoScaleMode = AutoScaleMode.Dpi; | ||
ClientSize = new Size(419, 144); | ||
ClientSize = new Size(425, 144); |
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.
Height needs to be adapted.
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.
shortened the text. This could still be an issue in some translations (French and German for instance)
This is positioned automatically and will not go further left
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.
Trivial MC (adjacent changes) to be resolved yet.
Since you have reviewed, I will squash and rebase tomorrow unless @RussKie protests |
Additional: I thought we discussed naming a lot for the original PR before we settled on something. |
We did but some features are hard to appreciate without actively using those first. Naming and UI are hard indeed. |
@mstv Do you want to add your latest tweaks too? |
showFindInCommitFilesGitGrepToolStripMenuItem, | ||
toolStripSeparatorScript, | ||
runScriptToolStripMenuItem}); | ||
DiffContextMenu.Items.AddRange(new ToolStripItem[] { diffUpdateSubmoduleMenuItem, diffResetSubmoduleChanges, diffStashSubmoduleChangesToolStripMenuItem, diffCommitSubmoduleChanges, submoduleStripSeparator, stageFileToolStripMenuItem, unstageFileToolStripMenuItem, resetFileToToolStripMenuItem, cherryPickSelectedDiffFileToolStripMenuItem, toolStripSeparator32, openWithDifftoolToolStripMenuItem, diffOpenWorkingDirectoryFileWithToolStripMenuItem, diffOpenRevisionFileToolStripMenuItem, diffOpenRevisionFileWithToolStripMenuItem, saveAsToolStripMenuItem1, diffEditWorkingDirectoryFileToolStripMenuItem, diffDeleteFileToolStripMenuItem, diffToolStripSeparator13, copyPathsToolStripMenuItem, openContainingFolderToolStripMenuItem, toolStripSeparator33, diffShowInFileTreeToolStripMenuItem, diffFilterFileInGridToolStripMenuItem, fileHistoryDiffToolstripMenuItem, blameToolStripMenuItem, findInDiffToolStripMenuItem, showFindInCommitFilesGitGrepDialogToolStripMenuItem, showFindInCommitFilesGitGrepToolStripMenuItem, toolStripSeparatorScript, runScriptToolStripMenuItem }); |
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.
Why is the format as this?
I can use difftastic to see that the order is the same but it seem unneeded.
Otherwise no comment on the changes
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.
Why is the format as this?
As mentioned in the commit message "chore(RevisionDiffControl): Saved without changes using Designer 17.11.3".
Don't ask me!
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.
I prefer to revert this change
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.
I prefer to revert this change
The next time someone needs to use the designer, the problem will pop up again.
And it already has: I have already had a hard evening rebasing and merging designer files because pull request reviews are not finished or do not happen.
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.
reverted because there are is another nonsense change by the Designer to be manually reverted.
Any further objections / vetos, @gitextensions/git-extensions-team?
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.
merge
Align names: FindInCommitFilesGitGrep in names (not Using) Find in commit files using git-grep in texts Refs: gitextensions#11858, addendum to gitextensions#11350
using Designer 17.11.3 Refs: gitextensions#11858
Addendum to #11350
Proposed changes
Screenshots
Before
After
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.