0

I'm in a huge repo with lots of committers and branches all over. I use gitk to visualize history and normally I limit the output using --glob=*IDENTIFIER*. However, if there are some branches pointing to commits that are in the filtered view - they are sill shown (even if their name doesn't include IDENTIFIER at all).
Is there a way to not show them?

Example

GitHub repo for screenshots: https://github.com/chhh/too-many-labels-in-gitk

I want to see only branch labels (remote or local) that have feature in them.
gitk --simplify-by-decoration --all sample simplified view of the repo:

simplified view of the repo gitk --all --simplify-by-decoration

I want to see just the feature branches.

gitk --simplify-by-decoration --glob=*feature/*

enter image description here

It's better, leaf branches such as garbage/11 at the top is gone now. But all the clutter from intermediate garbage and experiment branches is still visible I only want to see labels that start with feature/, i.e. remove the ones that are marked red in the next screenshot:

enter image description here

Dmitry Avtonomov
  • 8,747
  • 4
  • 32
  • 45
  • @SajibKhan 1) This is not a gitk solution (you need to do the filtering through git log, not grep) 2) This has the exact same result as `gitk --glob=*feature/*` - non-matching leaf branches are gone, but the extra branch names in what's printed are still present – Dmitry Avtonomov Sep 03 '21 at 19:45

1 Answers1

0

AFAIK gitk takes the exact same options as git log, so you can check git log's documentation.

Try : --decorate-refs=<pattern>

LeGEC
  • 46,477
  • 5
  • 57
  • 104
  • Yes, gitk does take the same options as git log. You can use `--decorate-refs-exclude=` to remove the "labels" from git log output. However, this does not affect gitk. Gitk will still paint those green/orange branch labels on every commit that has a ref. – Dmitry Avtonomov Sep 07 '21 at 17:35