vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

Adds AI rebase commands

Open sergeibbb opened this issue 5 months ago • 0 comments

Description

Resolves ???? (follow-up of #4443)

This is probably waiting for Commit Composer being able to re-compose.

(TODO: probably an issues with the following title should be created: "Add an option to generate commits from all changes on a branch")

(another TODO: be accurate with menu groups. Since the branch is old enough, the related groups could be renamed in main and items be reordered.

image

goes to issue description

Description

<-- Generating new commits from a set of current commits with Commit Composer currently requires picking a commit in the graph and initiating an "AI rebase" for all commits in a branch back to that point. While this is helpful for the specific case where you want to re-generate commits for a selection of commits, this is not very discoverable or intuitive for the case where someone wants to re-compose all commits on a branch.

There should be an option to generate commits for all changes on a branch that is accessible from multiple places:

  • in the context menu when right-clicking a branch ref in the graph
  • as a command palette command
  • from branches in other GitLens views

The "recompose" action in GL is currently called AI Rebase Current Branch onto Commit... (Preview) which only really works for that use case, so we will need a new name for this action - maybe something like Generate New Commits for this Branch (Preview)?

  • "Recompose branch commits" - merge base or merge target? -> closest to the current top
  • "Recompose unpushed commits" only when we have unpushed
  • "Explain Unpushed Changed"
  • Modifies "Explain Branch Changes" - by trying to find user-configured merge base.
image -->

Verification steps

  • [ ] test how each new menu item works
  • [ ] test that new menu items are visible when and only when there are commits (unpushed or unmerged): both in graph and in Branch View.
  • [ ] test how "Explain Branch Changes" works because it's base branch has been modified in getBranchMergeTargetName
  • [ ] test how other features that depend on getBranchMergeTargetName
    • [ ] Get Branch Contributions Overview
    • [ ] Comparison default

Checklist

  • [x] I have followed the guidelines in the Contributing document
  • [x] My changes follow the coding style of this project
  • [x] My changes build without any errors or warnings
  • [x] My changes have been formatted and linted
  • [x] My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • [x] My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • [x] My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

sergeibbb avatar Oct 02 '25 12:10 sergeibbb