From 9790a7e00cefa50d36d095beccb0901232514cb9 Mon Sep 17 00:00:00 2001 From: ZeroMask Date: Fri, 13 Dec 2024 17:33:57 +0300 Subject: [PATCH] docs: qlarify commit message prefix mechanics Added quote that qlarifies that users should use subgroups instead of regular match when configuring commit message prefixes --- docs/Config.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/Config.md b/docs/Config.md index 6bba175ad..ed39cd488 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -940,6 +940,14 @@ git: replace: '[$1] ' ``` +> [!IMPORTANT] +> The way golang regex works is when you use `$n` in the replacement string, where `n` is a number, it puts the nth captured subgroup at that place. If `n` is out of range because there aren't that many capture groups in the regex, it puts an empty string there. +> +> So make sure you are capturing group or groups in your regex. +> +> For example `^[A-Z]+-\d+$` won't work on branch name like BRANCH-1111 +> But `^([A-Z]+-\d+)$` will + ## Predefined branch name prefix In situations where certain naming pattern is used for branches, this can be used to populate new branch creation with a static prefix.