GitToolBox
GitToolBox copied to clipboard
Feature: Support templating in pattern branch completion formatters
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]]
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.
Hi, I'm considering using velocity for this feature so all kinds of custom logic will be possible :)