Is there a way to get branch name in a user-defined rule?
See original GitHub issueBy convention in our company we should put Jira ticket ID in the beginning of branch name (for example JIRA-123_do_something_great
) and also we should put ticket id in commit message. I would like to check if they are the same. For this I need to get branch name inside of validate
method of the rule. But I don’t see that there is some property in commit
or context
objects that would help me. Do I miss something or gitlint is not able to help me in this case?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Git Branching Naming Convention: Best Practices
The article describes the best practices of git branch naming. View seven best naming conventions to ensure their efficiency.
Read more >Which characters are illegal within a branch name?
Naming rules for refname: Git imposes the following rules on how references are named: They can include slash / for hierarchical (directory) ...
Read more >Git Branch Naming Rules and Conventions - YouTube
In Git we have a fair amount of freedom in how we name our branches. But there are some conventions and, most importantly,...
Read more >git-branch Documentation - Git
With --merged , only branches merged into the named commit (i.e. the branches whose tip commits are reachable from the named commit) will...
Read more >How to Setup Branch Protection Rules - Cycode
This field is dedicated to specifying the branch(es) for which these rules will apply. It supports regular expressions. If you only want these ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Released this yesterday as part of the 0.13.0 release - closing this out now 😃
Implemented. Will release this as part of the 0.13.0 release, hopefully soon 😃
Also, I think it would be nice to also have a
GitContext.current_branch
property. Adding that to the plan for 0.14.0 (probably not any time soon).