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

Add a menu item to delete both local and remote branch at once #3916

Merged
merged 1 commit into from
Sep 28, 2024

Conversation

stefanhaller
Copy link
Collaborator

  • PR Description

Add a menu item to delete both local and remote branch at once.

  • Please check if the PR fulfills these requirements
  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

Copy link

codacy-production bot commented Sep 15, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for e181de11 91.67%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (e181de1) Report Missing Report Missing Report Missing
Head commit (1ab70ec) 50586 43484 85.96%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3916) 96 88 91.67%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

"selectedBranchName": branch.Name,
},
)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I decided to put up only a single confirmation ("are you sure you want to delete both branches"). If the local branch is not merged, I append the warning about this below in the same popup. I like this better than putting up a separate popup for this after the first one, but I can change it if you disagree.

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

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

LGTM, great work. I agree about combining the messages: it makes for fewer keypresses

@stefanhaller stefanhaller force-pushed the better-branch-delete-confirmation branch from ba7d2f0 to c712b1d Compare September 28, 2024 09:19
Base automatically changed from better-branch-delete-confirmation to master September 28, 2024 09:22
@stefanhaller stefanhaller force-pushed the delete-local-and-remote-branch-at-once branch from 3cd47f3 to 1ab70ec Compare September 28, 2024 09:23
@stefanhaller stefanhaller merged commit c6a7722 into master Sep 28, 2024
16 checks passed
@stefanhaller stefanhaller deleted the delete-local-and-remote-branch-at-once branch September 28, 2024 09:26
@philbarto
Copy link

Hey @stefanhaller this may be a stupid question but you just press b when on a branch you're not checked out on to delete the local and remote branch, correct? That's what I could gather by reading the code but that doesn't do anything on my machine.

@mark2185
Copy link
Collaborator

@philbarto judging by the code it looks like it's a menu item, which is probably the delete menu behind d. One of the options in there should be under b.

@philbarto
Copy link

@mark2185 Yeah that's what I was thinking too, although I don't see the b option when trying to delete a branch

Screenshot 2024-10-24 at 12 20 50 PM

@mark2185
Copy link
Collaborator

@philbarto can't check exact dates on my phone, but check if this wasn't merged after v0.44.1 was released.

If you can build master from source, you should have it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants