j6t / git-gui

Tcl/Tk based UI for Git
12 stars 8 forks source link

Feature request: Ability to filter list of files by file name/path #3

Open smuuf opened 1 week ago

smuuf commented 1 week ago

Hi, I've always thought it would be handy to have the possibility to filter list of files by its name/path. Something like:

obrazek (yeah, I have some colors in git-gui.sh tweaked as a home-made attempt at dark mode GUI...)


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 to my_function_b and make a commit only from those files, even if I have hundreds of other changed files.

j6t commented 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:

smuuf commented 6 days ago

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.