branch

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateSlug

func DateSlug(message string) string

DateSlug returns a branch name in the format YYYY-MM-DD-slugified-message.

func FollowsNumbering

func FollowsNumbering(prefix, branchName string) bool

FollowsNumbering returns true if branchName matches the pattern {prefix}/\d+.

func NextNumberedName

func NextNumberedName(prefix string, existingBranches []string) string

NextNumberedName scans existingBranches for the highest number matching {prefix}/NN and returns {prefix}/{next} with zero-padded two digits.

func ResolveBranchName

func ResolveBranchName(prefix, message, explicitName string, existingBranches []string, numbered bool) (name string, info string)

ResolveBranchName implements the full decision tree for branch name generation.

Parameters:

  • prefix: configured stack prefix (may be empty)
  • message: commit message (from -m flag; may be empty if not using auto-naming)
  • explicitName: branch name provided as argument (may be empty)
  • existingBranches: current branch names in the stack
  • numbered: true if the stack uses auto-incrementing numbered branches

Returns the resolved branch name and an informational message (may be empty).

func Slugify

func Slugify(message string) string

Slugify converts a message into a URL/branch-safe slug. Lowercases, replaces special chars with hyphens, strips consecutive hyphens, and truncates to ~50 chars at a word boundary.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL