Open smuuf opened 1 week ago
If such a filter exists and not all files are listed, then an outstanding indication must be visible that indicates the fact. Otherwise, it would be all too easy to stage just part of the changed files.
Thinking a bit more on it:
Or highlight the files matching a pattern without removing the others?
This might also do it :)
My use case is that I'm having hundreds of files changed (like a massive refactoring), but for "good development process reasons" I'd like to separate all of these changes into logically standalone commits. I also know how to identify the files I'd like to have in the soon-to-be-commit (either by specific filename/part-of-path or by specific text in line diff), but I'm currently not able to distinguish them in the list of unstaged files.
The use case for having the "filter" (or highlights, as you suggest) applied in the list of staged files is the ability to undo the staging of some "accidentally" staged files during the process (e.g. the staged file XYZ doesn't match what the commit will be about, so it shouldn't be there and I want to unstage it).
All-in-all, both of your points are good points - and if there's no filtering but merely highlighting, IMHO, it also solves both of the points.
Hi, I've always thought it would be handy to have the possibility to filter list of files by its name/path. Something like:
(yeah, I have some colors in
git-gui.sh
tweaked as a home-made attempt at dark mode GUI...)*
meaning "one or more of any characters", i.e. regex.+
).my_dir_a*my_dir_b
would keep both of these:my_dir_in_repo/my_dir_a/whatever/my_dir_b/yay.php
my_dir_in_repo/my_dir_a_merged_with_my_dir_b
As a bonus, something similar would be handy in a form of "filter files by text search in diff". E.g. I could easily find all files where I renamed
my_function_a
tomy_function_b
and make a commit only from those files, even if I have hundreds of other changed files.