Skip to content

[Bug]: PowerShell create-new-feature keeps lowercase short words in branch names (case-insensitive -match) #3131

Description

@Quratulain-bilal

Bug Description

create-new-feature keeps a short (<3 char) word in the generated branch name only when that word appears in uppercase in the description, so acronyms like AI or ML survive while ordinary short words are dropped. the code comment says as much.

the bash script does this with a case-sensitive grep:

elif echo "$description" | grep -q "${word^^}"; then

the powershell script uses -match, which is case-insensitive by default:

} elseif ($Description -match "$($word.ToUpper())") {

because the word being tested was lowercased earlier, -match against its uppercased form always matches, so on powershell every short non-stop word is kept, not just acronyms.

Steps to Reproduce

  1. on powershell, run create-new-feature.ps1 -DryRun "go AI now"
  2. compare with bash create-new-feature.sh --dry-run "go AI now"

Expected Behavior

both shells produce the same branch name. go (lowercase 2-char word) is dropped, AI (uppercase acronym) is kept -> 001-ai-now.

Actual Behavior

powershell keeps the lowercase go too -> 001-go-ai-now, while bash gives 001-ai-now. same input, different branch name depending on the shell.

description bash powershell
go AI now 001-ai-now 001-go-ai-now
go to the pub 001-pub 001-go-pub

Specify CLI Version

main (current)

AI Agent

n/a (script-level)

Operating System

cross-platform (powershell)

Additional Context

suggested fix: use -cmatch (case-sensitive) instead of -match in scripts/powershell/create-new-feature.ps1, matching the bash grep. small diff.

note: i used an ai assistant to help investigate and write this up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions