GitToolBox icon indicating copy to clipboard operation
GitToolBox copied to clipboard

Feature: Support templating in pattern branch completion formatters

Open zielu opened this issue 3 years ago • 2 comments

Given branch name like feature/JIRA-1234_asdsd completion formatter should provider [JIRA-1234]. With current approach the best that can be done is JIRA-1234 with pattern (?:.+/)*(\w+-\d+).*

Templating support should provide one context list with contents of capture groups to reference them.

Final pattern for example would be achieved with following velocity output template: [matches[1]]

zielu avatar Sep 23 '21 14:09 zielu

Templating support would be very helpful.

Further, it would be nice to have default values or a simple if branching in the template. So that it is possible in your example if no ticket is given to completing [unknown] instead.

I have no idea if it is easily possible but maybe it is worth thinking of it when you implement it.

Fabianexe avatar Oct 20 '21 11:10 Fabianexe

Hi, I'm considering using velocity for this feature so all kinds of custom logic will be possible :)

zielu avatar Oct 20 '21 11:10 zielu