Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow deleting branches with 'd' (with a confirmation prompt) #541

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rahulk94
Copy link

fix #530

Description

This PR adds delete functionality by typing in d when on the heads remote. The user is prompted to enter y to confirm deletion and exits successfully after deleting the branch (similar to selecting a branch to avoid stale info being shown to the user).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • I have read the CONTRIBUTING document.
  • My commits follow the commitizen commit convention
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@rahulk94
Copy link
Author

Any chance you could take a look here @jwu910 some time soon?

@jwu910
Copy link
Owner

jwu910 commented Aug 18, 2023

Hi thanks for opening up this PR.

I've been incredibly busy and may not have time to review soon. Im also still on the fence whether or not the functionality is going to be necessary, and may want to consider brainstorming how this could potentially be an extension similar to the extra Git log commands we have in place.

If a user can add to the config store an array of commands, we can hide this behind a flag and or user defined option to allow for deleting

Let me try to think about this a bit too, but definitely appreciate this PR opening up

@rahulk94
Copy link
Author

Hey @jwu910 thanks for getting back to me. Yep no worries then. Have a think and let me know what you end up deciding.

Comment on lines +313 to +316
if (state.currentRemoteIndex !== 0) {
logger.error("Branch deletion is only available on heads");
return;
}
Copy link
Author

Choose a reason for hiding this comment

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

Bah there's a bug here as heads might not be index 0 always. So IF we decide to go ahead with this approach, I'll fix this up

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.

Feature request: allow deleting branches from check-it-out screen
2 participants