Skip to content
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

Hiding refs by pattern (to reduce git-branchless spam)? #1160

Closed
nyanpasu64 opened this issue Oct 27, 2021 · 4 comments · Fixed by #1172
Closed

Hiding refs by pattern (to reduce git-branchless spam)? #1160

nyanpasu64 opened this issue Oct 27, 2021 · 4 comments · Fixed by #1172

Comments

@nyanpasu64
Copy link

Installing git-branchless has resulted in it labeling large numbers of commits with meaningless refs which clutter the tig view. Is it possible to hide certain refs from tig by a regex/glob pattern?

Screenshot_20211026_180119

I looked at https://jonas.github.io/tig/doc/tigrc.5.html#_variables, and it seems the closest you can get is hide:, but you can't hide branches and unknown refs separately, nor can you hide refs/stash and refs/branchless separately if you want.

krobelus added a commit to krobelus/tig that referenced this issue Oct 28, 2021
The environment variable TIG_LS_REMOTE can be used to select the
references that Tig will display.

When using a command like TIG_LS_REMOTE='sh -c "a | b"' tig, we pass an
argv-array with 3 elements to execvpe.  The third argument is passed
with quotes, which means that the shell tries to run a command that
is literally called 'a | b'.

Fix this by removing quotes. We already split arguments with a
shell-like syntax, so this only improves compatibility.

This makes it easier filter away unwanted refs (jonas#1160) without creating
a script TIG_LS_REMOTE.
@krobelus
Copy link
Contributor

You can set TIG_LS_REMOTE to a script that runs something like git show-ref --head --dereference | grep -v refs/branchless/

I wonder if there is a good way to avoid creating such opaque references in the first place.

@arxanas
Copy link

arxanas commented Oct 28, 2021

Does tig support the log.excludeDecoration config option, as mentioned here? arxanas/git-branchless#171 (comment)

@krobelus
Copy link
Contributor

Not yet. I guess we'd need to reimplement Git's log.excludeDecoration filtering on the output of get_ref_list().

koutcher pushed a commit that referenced this issue Nov 11, 2021
The environment variable TIG_LS_REMOTE can be used to select the
references that Tig will display.

When using a command like TIG_LS_REMOTE='sh -c "a | b"' tig, we pass an
argv-array with 3 elements to execvpe.  The third argument is passed
with quotes, which means that the shell tries to run a command that
is literally called 'a | b'.

Fix this by removing quotes. We already split arguments with a
shell-like syntax, so this only improves compatibility.

This makes it easier filter away unwanted refs (#1160) without creating
a script TIG_LS_REMOTE.
@koutcher
Copy link
Collaborator

We could also introduce a new reference category other to allow the use of set reference-format = hide:other to hide these references which aren't heads, tags, branches...

koutcher added a commit to koutcher/tig that referenced this issue Nov 26, 2021
This makes it possible to filter refs created by tools such as git-branchless
with `set reference-format = hide:other`.

Closes jonas#1160
koutcher added a commit to koutcher/tig that referenced this issue Nov 27, 2021
This makes it possible to filter refs created by tools such as git-branchless
with `set reference-format = hide:other`.

Closes jonas#1160
koutcher added a commit to koutcher/tig that referenced this issue Nov 27, 2021
This makes it possible to filter refs created by tools such as git-branchless
with `set reference-format = hide:other`.

Closes jonas#1160
koutcher added a commit that referenced this issue Jan 4, 2022
This makes it possible to filter refs created by tools such as git-branchless
with `set reference-format = hide:other`.

Closes #1160
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 a pull request may close this issue.

4 participants