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
Rename detection for Advanced filter #9413
Rename detection for Advanced filter #9413
Conversation
d69f4dc
to
2f271f3
Compare
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.
Let's get it in before I get to the history dialog in my clean up.
} | ||
catch | ||
{ | ||
SetPage(new ErrorControl()); | ||
throw; | ||
} | ||
|
||
return; | ||
string BuildPathFilter(string? path) |
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.
❗ We really need to test 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.
Can we take this later?
There are several PRs that depends on this PR.
The quoting handling is making some guessing, but as the handling ultimately uses Git to ignore bad paths, it should not be critical.
The quoting and --follow handling can be separated.
...and I have raised my opinions about the usefulness about parsing internal methods like this before...
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.
Can we take this later?
Sure
..and I have raised my opinions about the usefulness about parsing internal methods like this before...
If we don't have tests, there's a high change we'll either keep churning here trying to fix unintended regressions, or regress while updating the functionality.
2f271f3
to
d14448c
Compare
Suggest squash merging in a day or so. |
public void SetPathFilter(string filter) | ||
{ | ||
FileFilterCheck.Checked = !string.IsNullOrWhiteSpace(filter); | ||
FileFilter.Text = filter?.Trim(); |
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.
Have you considered filenames with spaces at start/end?
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.
GE added filenames (for FileHistory and a later PR for a context menu for RevDiff etc) are quouted when adding.
User added paths in Advanced filter must be correctly quoted by the user.
(There is a helper for quoting paths without spaces and quotes, likely the most common case).
A separate commit with the renaming would ease the review a little.
This was separated in several commits until I squashed it preparing for merge.
But commits are still separate in branch gerhardol/feature/i7598-replace-formfilehistory
A separate commit with the renaming would ease the review a little. |
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.
Almost OK for me.
This was separated in several commits until I squashed it preparing for merge.
My 2ct: I would keep such plain refactoring commits separate.
Since my available time is getting less, I have started my review after the requested changes were done.
(Not requesting changes neither for the edge case with spaces nor for separate commits.)
But commits are still separate in branch gerhardol/feature/i7598-replace-formfilehistory
This branch does not match. I have split it myself for reviewing.
Filename rename detection requires a separate `git-log --follow` Move this handling from FileHistory to RivisionGridControl to use this handling also for path filters in Advanced filter. * FileHistory: No --follow for folders Normally not interesting, can give extremely long command line paths. * Always quote internal (i.e. FileHistory) paths Assume manual filter paths are quoted correctly. git-log --follow only accepts one path argument. * Skip --find-renames and --find-copies in git-log to get the full revision history as they have no effect. * Use Advanced filter also for FileHistory paths
d14448c
to
85f97ba
Compare
Separated to a refactor commit. Squashed the two minor changes and modified the HEAD commit message, so RussKie can rebase merge this PR to get going with his changes. |
the common name of the control used in other forms.
Filename rename detection requires a separate `git-log --follow` Move this handling from FileHistory to RivisionGridControl to use this handling also for path filters in Advanced filter. * FileHistory: No --follow for folders Normally not interesting, can give extremely long command line paths. * Always quote internal (i.e. FileHistory) paths Assume manual filter paths are quoted correctly. git-log --follow only accepts one path argument. * Skip --find-renames and --find-copies in git-log to get the full revision history as they have no effect. * Use Advanced filter also for FileHistory paths
85f97ba
to
ea8b1aa
Compare
Rebased on master, squashing #9413 (review) and activate the comment discussed in #9413 (comment) due to #9056. |
|
👍
|
Filename rename detection requires a separate `git-log --follow` Move this handling from FileHistory to RivisionGridControl to use this handling also for path filters in Advanced filter. * FileHistory: No --follow for folders Normally not interesting, can give extremely long command line paths. * Always quote internal (i.e. FileHistory) paths Assume manual filter paths are quoted correctly. git-log --follow only accepts one path argument. * Skip --find-renames and --find-copies in git-log to get the full revision history as they have no effect. * Use Advanced filter also for FileHistory paths
ea8b1aa
to
f6bc83d
Compare
(switched order Text/Checked in FormFileHistory.cs as setting Checked triggers |
See long term goals in #7598
Proposed changes
Refactor FileChanges -> RevisionGrid (the normal name for the control in other forms)
Do not try to
--follow
for folders. Something likeBin/
is OK, butGitUI
will give too many files and too long command lines. (This could be solved in other ways but do not bother.)Note that 3.5 does not follow folders (or Submodules) so not limiting functionality. History for folders is useless in 3.5 as well.
Note: There is no enforcing of using the ending "/" in the Advanced filter, manual input.
Move detection of renamed files from FileHistory to RevisionGrid, to use the handling also for Advanced filters (with slightly more general rules).
Test methodology
Add an advanced filter like "**/Rev*Diff*" to see that GitUI\CommandsDialogs\RevisionDiffControl.cs was renamed
✒️ I contribute this code under The Developer Certificate of Origin.