Skip to content

Conversation

@lszomoru
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings December 16, 2025 10:56
@lszomoru lszomoru enabled auto-merge December 16, 2025 10:56
@lszomoru lszomoru self-assigned this Dec 16, 2025
@lszomoru lszomoru added this to the December / January 2026 milestone Dec 16, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the Copilot CLI worktree creation functionality by automatically assigning a branch name to newly created worktrees. The change ensures that isolated worktrees for CLI sessions have unique, timestamped branch names that respect the user's Git branch prefix configuration.

Key Changes

  • Added automatic branch name generation when creating worktrees for CLI session isolation
  • Branch names follow the format: <git.branchPrefix>worktree-<timestamp> where timestamp is a filesystem-safe ISO string

Comment on lines +131 to +132
const branchPrefix = workspace.getConfiguration('git').get<string>('branchPrefix') ?? '';
const branch = `${branchPrefix}worktree-${new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19)}`;
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The branch name generation uses new Date().toISOString() which uses UTC time. This could potentially create confusion when multiple worktrees are created in quick succession or when debugging issues, as the timestamp won't reflect the user's local time zone. Consider using a more unique identifier or adding additional entropy (like a random suffix) to ensure uniqueness even if multiple worktrees are created within the same second.

Copilot uses AI. Check for mistakes.
@lszomoru lszomoru added this pull request to the merge queue Dec 16, 2025
Merged via the queue into main with commit ed2c7aa Dec 16, 2025
22 checks passed
@lszomoru lszomoru deleted the lszomoru/alive-wolf branch December 16, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants