Skip to content

Allow to toggle revision filtering#1173

Closed
krobelus wants to merge 3 commits intojonas:masterfrom
krobelus:toggle-rev-filter
Closed

Allow to toggle revision filtering#1173
krobelus wants to merge 3 commits intojonas:masterfrom
krobelus:toggle-rev-filter

Conversation

@krobelus
Copy link
Copy Markdown
Contributor

No description provided.

argv_format() takes two boolean parameters, and the next patch wants
to add another one.

Add the same bitfield to struct format_context, instead of just the
file-filter bit.  This is not strictly needed -- we don't read the
extra bits -- but this forces us to consistently access it with "&
argv_flag_file_filter", also in callees of argv_format().
"tig -- <pathspec>" shows only commits that touch files matching
<pathspec>.  The command ":toggle file-filter" (bound to %) can be
used to toggle this filtering dynamically.

"tig <revisions range>" shows only commits in the given range.
This patch adds ":toggle rev-filter" (bound to ^) to quickly toggle
this filter.

There is already ":toggle rev-args" which is meant to disable rev
filtering but that does not work because it fails to redraw the
view. Also it cannot re-enable filtering.
Also ":set rev-args = HEAD" works but doesn't redraw the view either.
We should fix that (should be easy but I didn't check yet), and make
":toggle rev-args" reversible, then both the rev-filter and file-filter
toggles will be obsolete.

This feature is particularly useful with a new feature in Tig 2.5.2:
when pressing m in the blame view, Tig will show the blamed commit
centered in the main view, making it easy to explore adjacent
commits. Note that if there are many commits between the blamed commit
and HEAD, you'll need to wait a bit after pressing m.
@koutcher
Copy link
Copy Markdown
Collaborator

Thanks, I found myself several times having to restart tig without revision argument when playing with the blame view, this will be really useful.
There are more variables that do not trig a refresh as they should. I remembered checking that a while ago but I never got time to test it well enough to make a PR. I rebased it and pushed it at https://github.com/koutcher/tig/commits/wip-option-refresh if you want to have a look.

koutcher pushed a commit that referenced this pull request Jan 7, 2022
"tig -- <pathspec>" shows only commits that touch files matching
<pathspec>.  The command ":toggle file-filter" (bound to %) can be
used to toggle this filtering dynamically.

"tig <revisions range>" shows only commits in the given range.
This patch adds ":toggle rev-filter" (bound to ^) to quickly toggle
this filter.

This feature is particularly useful with a new feature in Tig 2.5.2:
when pressing m in the blame view, Tig will show the blamed commit
centered in the main view, making it easy to explore adjacent
commits. Note that if there are many commits between the blamed commit
and HEAD, you'll need to wait a bit after pressing m.

[tk: fixed tab in manual.adoc and tweaked the log message]
@koutcher koutcher closed this Jan 7, 2022
vxsl pushed a commit to vxsl/tig that referenced this pull request Mar 18, 2026
"tig -- <pathspec>" shows only commits that touch files matching
<pathspec>.  The command ":toggle file-filter" (bound to %) can be
used to toggle this filtering dynamically.

"tig <revisions range>" shows only commits in the given range.
This patch adds ":toggle rev-filter" (bound to ^) to quickly toggle
this filter.

This feature is particularly useful with a new feature in Tig 2.5.2:
when pressing m in the blame view, Tig will show the blamed commit
centered in the main view, making it easy to explore adjacent
commits. Note that if there are many commits between the blamed commit
and HEAD, you'll need to wait a bit after pressing m.

[tk: fixed tab in manual.adoc and tweaked the log message]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants