Skip to content

Conversation

@littleKitchen
Copy link

Closes #2663

Summary

Adds a new config option git.branchWhitespaceReplacement that allows users to specify the character used to replace whitespace when creating or renaming branch names.

Motivation

Some teams use underscores instead of dashes in branch names (e.g., feature_my_branch instead of feature-my-branch). This change allows users to configure their preferred character.

Usage

Add to your config:

git:
  branchWhitespaceReplacement: '_'

The default value is - (dash), maintaining backward compatibility.

Changes

  • Added BranchWhitespaceReplacement config option with default value "-"
  • Modified SanitizedBranchName to accept replacement character as parameter
  • Added SanitizedBranchNameWithConfig helper method on RefsHelper
  • Updated branch creation and rename operations to use the configured character

Testing

  • Build passes (go build ./...)
  • Manually verified the config is respected when creating new branches
Closes jesseduffield#2663

Adds a new config option `git.branchWhitespaceReplacement` that allows
users to specify the character used to replace whitespace in branch names.

By default, spaces are replaced with dashes ('-'), but teams that prefer
underscores or other characters can now configure this behavior.

Example config:
```yaml
git:
  branchWhitespaceReplacement: '_'
```

Changes:
- Added `BranchWhitespaceReplacement` config option (default: '-')
- Updated `SanitizedBranchName` to accept replacement parameter
- Added `SanitizedBranchNameWithConfig` helper method on RefsHelper
- Updated all callers to use the new config-aware method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant