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

3528 Change `branch` terminal-run commands into normal commands w/ proper error handling

Open sergiolms opened this issue 1 year ago • 3 comments

Description

Part 2 including changes to branch delete. Resolves #3528

Example of error: Captura de pantalla 2024-09-30 a las 16 10 45

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

sergiolms avatar Sep 20 '24 09:09 sergiolms

@sergiolms Please apply similar changes from https://github.com/gitkraken/vscode-gitlens/pull/3596 to this PR

eamodio avatar Sep 26 '24 21:09 eamodio

Now when an error such as unmerged branch happens, we display a prompt to retry it:

Captura de pantalla 2024-10-03 a las 12 59 07

We can turn this prompt into something reusable like a confirmation prompt we can parametrize as we find more cases

sergiolms avatar Oct 03 '24 15:10 sergiolms

When attempting to delete a remote branch that no longer exists, I do not get the right error message in the notification area. I get a push error that doesn't describe the issue well: [...] It is true that the operation happening under the hood is git push -d origin cool-branch but I expected an error relating to "unable to delete branch because the remote branch was already deleted" or however you have the messaging set up.

True. Since this action is running under git push it wasn't covered by the git branch errors. I added an additional case to git push to handle that case:

Captura de pantalla 2024-11-11 a las 15 22 58

sergiolms avatar Nov 11 '24 14:11 sergiolms