Skip to content

Conversation

sergeibbb
Copy link
Member

@sergeibbb sergeibbb commented Sep 2, 2024

Description

Adds 2 new options to delete the branch as part of the worktree delete.
Which will after the completion of the worktree(s) delete, will start the delete branch(es) flow (at it confirmation step – which will naturally happen if all the context is provided to that flow)

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • 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 added a commit that referenced this pull request Sep 2, 2024
@sergeibbb sergeibbb force-pushed the feature/GLVSC-637-delete-worktree-and-branch branch from ae0dbe8 to 572ef21 Compare September 2, 2024 16:22
sergeibbb added a commit that referenced this pull request Sep 2, 2024
@sergeibbb sergeibbb force-pushed the feature/GLVSC-637-delete-worktree-and-branch branch from 572ef21 to 7a5d919 Compare September 2, 2024 16:30
@sergeibbb sergeibbb marked this pull request as ready for review September 2, 2024 16:37
Comment on lines 322 to 339
const branchesOfDeletedWorktrees = yield* this.deleteCommandSteps(
state as DeleteStepState,
context,
);
if (branchesOfDeletedWorktrees !== StepResultBreak && branchesOfDeletedWorktrees?.length) {
yield* getSteps(
this.container,
{
command: 'branch',
state: {
subcommand: 'delete',
repo: state.repo,
references: branchesOfDeletedWorktrees,
},
},
this.pickedVia,
);
}
Copy link
Member

Choose a reason for hiding this comment

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

Could we move this into this.deleteCommandSteps? I tried it locally and it seems fine.

Copy link
Member

@eamodio eamodio left a comment

Choose a reason for hiding this comment

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

Looks good overall!

Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

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

I don't have much context into this, and I'm not sure how many ways it can break, so I was only able to test easy/happy flows.

I think this is fine as it stands, but in the future, I think we can improve it by waiting to complete any action until all choices are made. I.e. if I choose "delete worktree and branch", do not delete the worktree until I have confirmed my "delete branch" choice in the next step.

@axosoft-ramint
Copy link
Contributor

@sergeibbb You have conflicts in the CHANGELOG file. Once those are addressed we can merge.

@sergeibbb sergeibbb force-pushed the feature/GLVSC-637-delete-worktree-and-branch branch from 7a5d919 to c029552 Compare September 3, 2024 17:26
@eamodio eamodio merged commit 513ebb6 into main Sep 3, 2024
1 check passed
eamodio pushed a commit that referenced this pull request Sep 3, 2024
@sergeibbb sergeibbb deleted the feature/GLVSC-637-delete-worktree-and-branch branch September 3, 2024 17:40
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