Skip to content

Add an option to generate commits from all changes on a branch #4443

@justinrobots

Description

@justinrobots

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions