Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,601
Community Members
 
Community Events
176
Community Groups

Limit Branches size name using pre-hooks

Hello, as the title says i'm looking for a way to limit the name of bitbukets branches to 50 characters.  Do you know any way ? i'm trying to do a bash script using Scriptrunner to make this as a pre-hook but i can't manage to make it work.

1 answer

1 accepted

0 votes
Answer accepted

With the Better Commit Policy app, you can implement a rule which matches the branch name against a regular expression. The regex can limit the number of chars to 50 (and do a million of other things).

The left-side example shows a similar use case with branch names:

rejected-tag-branch.png

See:

  1. The app: https://marketplace.atlassian.com/apps/1214430/better-commit-policy-for-bitbucket?hosting=server&tab=overview
  2. The related doc: https://midori-global.com/products/better-commit-policy-for-bitbucket/server/documentation/#verifying-branches-and-tags-created-in-bitbucket
  3. You have to use this condition: https://midori-global.com/products/better-commit-policy-for-jira/server/documentation/#branch-pattern-condition
  4. Here is a sample regex that requires a text be at least N chars: https://midori-global.com/products/better-commit-policy-for-jira/server/documentation/best-practices#commit-message-length (you should be able to figure out yours based on this)

(Discl. I'm a developer working on this paid and supported app.)

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events