question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to get branch name in a user-defined rule?

See original GitHub issue

By 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:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jorisrooverscommented, Feb 26, 2020

Released this yesterday as part of the 0.13.0 release - closing this out now 😃

1reaction
jorisrooverscommented, Feb 16, 2020

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found