Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

When starting work on an issue, the extension automatically switches to the default branch before creating the issue branch, making this behavior opaque to users. This adds a setting to control which branch is used as the base.

Changes

  • New setting: githubIssues.workingBaseBranch with three values:

    • currentBranch (default): Branch from current HEAD without switching
    • defaultBranch: Switch to default branch first (previous behavior)
    • prompt: Ask user which branch to use as base
  • Implementation: Modified IssueFeatureRegistrar.doStartWorking() to read the setting and conditionally pass checkoutDefaultBranch to StateManager.setCurrentIssue()

Example

With workingBaseBranch: "prompt", users see actual branch names:

Which branch should be used as the base for the new issue branch?
  > feature-branch
    main

The prompt displays the actual current branch name and the repository's default branch name, making it clear which branches are being compared. If the current branch is already the default branch, no prompt is shown.

This makes the branching behavior transparent and gives users control over whether issue branches are created from their current context or the repository default.

Original prompt

This section details on the original issue you should resolve

<issue_title>Ask which branch to branch off from</issue_title>
<issue_description>https://github.com/microsoft/vscode-internalbacklog/issues/1021

With githubIssues.alwaysCreateDraftPR it might make sense to ask the user where to branch off from and if to branch off at all (related #1706).

Currently when working on an issue and starting to work on another issue, the branch is first switched back to master and then the new branch is created from there. If not working on an issue, the current branch is branched off from. Doing this automatically is not transparent to the user.</issue_description>

<agent_instructions>Add a new setting githubIssues.workingBaseBranch. The default value should be currentBranch, and it should also have the values defaultBranch and prompt. Implement the setting.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits December 9, 2025 10:35
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Add setting for working base branch selection Add githubIssues.workingBaseBranch setting to control base branch selection Dec 9, 2025
Copilot AI requested a review from alexr00 December 9, 2025 10:46
Comment on lines 835 to 836
const currentBranchOption = vscode.l10n.t('Current Branch');
const defaultBranchOption = vscode.l10n.t('Default Branch');
Copy link
Member

Choose a reason for hiding this comment

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

@copilot use the actual branch names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 4245367. The prompt now shows actual branch names (e.g., "feature-branch" and "main") instead of generic localized labels.

@@ -0,0 +1,201 @@
/*---------------------------------------------------------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

@copilot Tests fail, delete them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleted in 4245367.

Copilot AI and others added 2 commits December 11, 2025 15:25
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI requested a review from alexr00 December 11, 2025 15:31
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.

Ask which branch to branch off from

2 participants