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
Sync advanced filter and filters toolbar #9580
Conversation
Current status:
|
I believe I got to the point where I'm generally happy with the code and how it behaves, so feel free take it for a spit. I'll start working on tests next.
This functionality was added many years ago for msysgit 1.7.3.1, which dates back to 2010. From the commit message:
I'll install the latest msysgit and see if I can test it, but in general I see no compelling reason to support such old tech. |
Installed the "latest" msysgit 1.9.5 (which is ~6 years old), everything appears to be working as expected: |
d6e3cbb
to
c1971fc
Compare
Msysgit 1.x evolved into Git-for-windows 2.x so there is to my knowledge nothing special about msysgit 1.7.
The behavior could well be changed too, but this should be investigated. Not sure what chars to test with |
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.
} | ||
|
||
OnFilterChanged(); | ||
// TODO: there's an opportunity to reduce refreshes by tracking the current state |
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.
How did you see that requireRefresh
is not required?
I tried to backtrack this briefly and it could be OK to remove.
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 was always set to true
, except in some odd scenario when we reset the filter before switching the repo (or something like that). I have reworked the whole structure and the flow of filters, and this flag is superficial. We always need to refresh the grid whenever a filter changes.
I added the TODO note here because we can optimise the flow, and possibly skip a refresh if we detect that the branch filter value hasn't changed. But this is a function of the revision grid, and not the caller.
{ | ||
AppSettings.BranchFilterEnabled = !string.IsNullOrWhiteSpace(filter); | ||
// TODO: clean up and move all internals to FilterInfo |
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.
Will this and similar TODO be added to this PR?
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.
Some of them - yes, some of them I'll likely leave for another time.
I've tested with Russian text. If this removal becomes an issue we'll hear about it. |
45c4d56
to
70f6f47
Compare
38228b9
to
034af29
Compare
I guess we will have to test with something submitted in *nix and that has some special characters |
To me this would only reinforce the idea this functionality is superfluous,
and there's no need to have it.
|
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.
To me this would only reinforce the idea this functionality is superfluous, and there's no need to have it.
You can say the same about any minor functionality. There may well be some teams where this functionality is something they rely on.
The consequences must be investigated.
There are some functionality changes currently, like if unchecking a filter box, the value is forgotten (then the box is not needed).
Applying fixes in the rebase I am pushing on my rebase on #9445 (not finished yet)
Exactly 😆 https://xkcd.com/1172/ |
🤣
I'm happy to investigate when there's a real use case.
|
I pushed some updates to my repo, fixing some regressions in the form handling. Plan to merge #9445 tomorrow
Use case:
|
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.
With the changes in my branch, the behavior iof the filter is similar to know.
Basically, the changes in this branch was applied in the merge, the filterbehavior was restored in the first fixup and the functionality adapted in second fixup. (info is stale, I cannot force-push to your repo).
Not too much usage myself.
The in-memory handling need to be investigated....
034af29
to
d6f25e6
Compare
Do you have a sample repo to try? I don't have any non Windows VMs readily available to test.
I rebased stomping over your filter-related changes, then restored what looked relevant in e9ee2cb with some tweaks. Please have a look, feel free to push into my branch, if there's anything I missed. |
There is a clear use case - not so important to myself. I will try to setup a separate repo
The first of my commits with most changes and the fixes to the form behavior was missing reapplied. |
1b294da
to
8fe483a
Compare
My fork is open, are you not able to push in to this branch? |
Stale branch, not even force push |
71d5346
to
9733dca
Compare
Looking at your fork it seems that you took an outdated copy (I switched the order of commits). The MC was fixed with a auto-fix by the merge tool. |
EnableFilters(); | ||
base.OnLoad(e); | ||
|
||
FilterInfo rawFilterInfo = _filterInfo with { IsRaw = true }; |
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 .NET records
make it really simple yet allow retaining the encapsulation.
9733dca
to
36431db
Compare
All green |
@gerhardol is there anything else outstanding? |
Filters, are not tested There are also some git commands executed when starting with the dash board, that may occur due to my patches. I have been busy the last weeks. |
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.
-
Git errors at startup
Occurs in my rebase on master, not in this PR. This is when starting to the dashboard and BuildIntegration is configured.
This need to be checked after rebase though. -
Search
I can search when adding commits in Windows vs Linux (WSL) using 8 bit characters like åäöñ.
That indicates the functionality is good enough for me, encoding in WSL should be done the same in Linux/Windows now. (Changed in Git 2?).
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.
nothing critical, have not run it yet but from now on
revisionDiff.FallbackFollowedFile = pathFilter; | ||
fileTree.FallbackFollowedFile = pathFilter; | ||
Text = _appTitleGenerator.Generate(Module.WorkingDir, Module.IsValidGitWorkingDir(), branchSelect.Text, TranslatedStrings.NoBranch, RevisionGrid.GetPathFilter()); | ||
RevisionGrid.ForceRefreshRevisions(); | ||
RevisionGrid.SetAndApplyPathFilter(pathFilter.QuoteNE()); |
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 FormFileHistory, .QuoteNE()
has been removed. Should SetAndApplyPathFilter
quote itself if necessary, shouldn't it?
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.
Quotes should be set in RevDiff and RevFileTree, from that on the field is just text, can be manipulated in the form.
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.
@mstv I haven't spent any time looking at FormFileHistory, so I can't really comment on its behaviours.
@gerhardol is quoting here necessary?
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.
The path must be quoted in the Git command, but the form has just free text that may not be quoted automatically, the user may enter smarter queries.
The path need to be added when converted from Path to string
to be added to the filter. Will look into that later.
GitUI/UserControls/RevisionGrid/Columns/RevisionGraphColumnProvider.cs
Outdated
Show resolved
Hide resolved
IntegrationTests/UI.IntegrationTests/CommandsDialogs/FormBrowseTests.cs
Outdated
Show resolved
Hide resolved
With fd36da6, the MEF encounters an ambiguity with
|
* Apply the same design as for other updated dialogs * Only apply changes when users clicks [OK] button * Remove all filtering logic Contributes to gitextensions#6183
36431db
to
f0ed43e
Compare
I'm not observing any issues. Try |
I am no observing any issues after the rebase. I have also copied the artifacts to a separate location and run from there - observed no errors.
👍 |
The repo objects loaded (and for build info tab) is not due to this PR and master has more failed command.
Some previous commit (or just when rebasing?) loaded the plugins twice, not now. Have not looked at the tests but I would like to see this merged. |
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.
SplitterPositionsShouldBeRestored() fails too
265783a
to
0373c5d
Compare
A major clean up of all filter related functionality in RevisionGrid control. * Move all filter-related info into a dedicated filter class FilterInfo * Move all filter-related AppSettings from RevisionGrid into FilterInfo * Move calculations of RefFilterOptions from RevisionGrid into FilterInfo Clean up FilterToolbar to react to FilterChanged events, and update its state from the event payload. Relates to gitextensions#9553
0373c5d
to
90951db
Compare
The test coverage is not ideal, but I think we can take it as is. I'll look into improving the test coverage later. |
Fixes #9553 (review)
Proposed changes
AdvancedFilterInfo
Screenshots
Before
After
Test methodology