Skip to content

Add option to specify custom branch name #6

Description

@patrick91

Problem

Currently, branch names are always auto-generated from the commit message with no way to override. This can be limiting when:

  • The commit message doesn't translate well to a branch name
  • User has a specific naming convention
  • Multiple commits with similar messages create confusing branch names

Examples from Other Tools

Charcoal:

charcoal create -n my-custom-branch -m "My commit message"

st:

st create my-custom-branch  # Or prompts interactively

Proposed Solution

Add a --name (or -n) flag to the create command:

shortcake create --name my-feature-branch

Implementation Options

Option 1: Flag Only

shortcake create --name custom-branch
# Opens editor, commits, uses 'custom-branch' as name

Option 2: Interactive Fallback

shortcake create
# After commit, show: "Generated branch name: add-new-feature"
# Prompt: "Use this name? [Y/n] (or enter custom name):"

Option 3: Positional Argument

shortcake create [branch-name]
# If provided, use it; otherwise auto-generate

User Stories

  • As a developer, I want to use my team's branch naming convention (e.g., feature/TICKET-123-description)
  • As a developer, I want to preview the auto-generated name and change it if needed
  • As a developer, I want to create branches without committing first (empty branch for future work)

Implementation Notes

Related code: shortcake/cli.py:125-132

Would need to modify the create command to accept an optional name parameter and skip auto-generation if provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions