vscode-git-graph icon indicating copy to clipboard operation
vscode-git-graph copied to clipboard

Regex branch filtering

Open Awbmilne opened this issue 4 years ago • 3 comments

Describe the feature that you'd like Regex based branch filtering, and maintain branch selection between Git Graph closes

Additional context (optional) For corporate repositories with hundreds of branches based features/buxfixes, it is difficult to select a list of branches to view. One nice solution could be to allow regex based branch filtering (in branch search or another field). This would allow looking for keywords or a ticket/issue number in the branch name.

This would only really be useful if the regex was kept when you closed/reopened Git Graph. Not sure how practical a change like that is, but would sure help me out!

Thanks for the great work with this extensions! Saves me so much time and headache!

Awbmilne avatar Dec 01 '21 19:12 Awbmilne

WOW! This already sorta exists! Using glob!

For those hunting

Use the git-graph.customBranchGlobPatterns setting, like so:

"git-graph.customBranchGlobPatterns": [
        {
            "name": "My Branch Filter",
            "glob": "heads/*keyword*"
        },
        {
            "name": "My Other Branch Filter",
            "glob": "heads/feature/*"
        },
        {
            "name": "My Another Filter",
            "glob": "heads/<Jira Tag>:*"
        }
    ],

While its not as good as full Regex, and not GUI accessible, it is extremely useful!

I feel like a Regex version/expansion could useful, and an easier way to use it from the GUI, so that this functionality can be used on a daily bases without needed to play with the setting.json.

Awbmilne avatar Dec 01 '21 19:12 Awbmilne

@Awbmilne do you know by glob how to filter remote branch only? I want show only "origin/release-*" branches. Thank you!

shaofeng66 avatar Jun 02 '23 08:06 shaofeng66

@Awbmilne do you know by glob how to filter remote branch only? I want show only "origin/release-*" branches. Thank you!

Answering my own question:


        {
            "name": "remote release branches",
            "glob": "remotes/origin/release-*"
        },

shaofeng66 avatar Jun 26 '23 08:06 shaofeng66