Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/project/repository/push_rules.md')
-rw-r--r--doc/user/project/repository/push_rules.md12
1 files changed, 7 insertions, 5 deletions
diff --git a/doc/user/project/repository/push_rules.md b/doc/user/project/repository/push_rules.md
index fbadc9b84a3..81896d64815 100644
--- a/doc/user/project/repository/push_rules.md
+++ b/doc/user/project/repository/push_rules.md
@@ -71,11 +71,13 @@ Use these rules for your commit messages.
- **Require expression in commit messages**: Messages must match the
expression. To allow any commit message, leave empty.
- Uses multiline mode, which can be disabled by using `(?-m)`.
+ Uses multiline mode, which can be disabled by using `(?-m)`. Some validation examples:
+
+ - `JIRA\-\d+` requires every commit to reference a Jira issue, like `Refactored css. Fixes JIRA-123`.
+ - `[[:^punct:]]\b$` rejects a commit if the final character is a punctuation mark.
+ The word boundary character (`\b`) prevents false negatives, because Git adds a
+ newline character (`\n`) to the end of the commit message.
- For example, if every commit should reference a Jira issue
- (like `Refactored css. Fixes JIRA-123.`), the regular expression would be
- `JIRA\-\d+`.
- **Reject expression in commit messages**: Commit messages must not match
the expression. To allow any commit message, leave empty.
Uses multiline mode, which can be disabled by using `(?-m)`.
@@ -230,7 +232,7 @@ These examples use regex (regular expressions) string boundary characters to mat
the beginning of a string (`^`), and its end (`$`). They also include instances
where either the directory path or the filename can include `.` or `/`. Both of
these special regex characters must be escaped with a backslash `\\` if you want
-to use them as normal characters in a match condition.
+to use them as standard characters in a match condition.
- **Prevent pushing `.exe` files to any location in the repository** - This regex
matches any filename that contains `.exe` at the end: