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

When force deleting a branch, use -D instead of --delete --force to increase backwards compatibility #547

Closed
krzikalla opened this issue Aug 2, 2021 · 2 comments
Assignees
Labels
improvement An improvement to existing functionality
Milestone

Comments

@krzikalla
Copy link

krzikalla commented Aug 2, 2021

I tried to force delete a branch. GitGraph uses git branch --delete --force name, which is unsupported by git V1.8.3. Native VS Code uses git branch -D name, which works.
It took me some time to figure out the reason for the failure (the error message only tells me how to use git branch). A warning about a too old git version for GitGraph would be helpful in such cases.

@krzikalla krzikalla added the feature request Feature request label Aug 2, 2021
@mhutchie mhutchie added improvement An improvement to existing functionality and removed feature request Feature request labels Aug 2, 2021
@mhutchie mhutchie added this to the v1.31.0 milestone Aug 2, 2021
@mhutchie
Copy link
Owner

mhutchie commented Aug 2, 2021

Hi @krzikalla,

Visual Studio Code itself issues a warning when Git < 2.0.0 is used, which the user must dismiss (so the extension doesn't duplicate the same warning). Additionally, I do implement warning messages when the extension needs to use a Git command / argument that was more recently introduced to Git, when the user attempts to use it.

In this specific case, I didn't spot the incompatibility because while both --delete and --force arguments do exist for git branch in older versions of Git, there is additional logic internally within Git that prevents them from being used together. Thank you for making me aware of it!

I'll adjust the extension to use git branch -D, instead of git branch --delete --force, as it will increase the backwards compatibility of the extension.

@mhutchie mhutchie changed the title Issue a warning, if an unsupported git version is detected When force deleting a branch -D instead of --delete --force to increase backwards compatibility Aug 2, 2021
@mhutchie mhutchie changed the title When force deleting a branch -D instead of --delete --force to increase backwards compatibility When force deleting a branch, use -D instead of --delete --force to increase backwards compatibility Aug 2, 2021
@mhutchie
Copy link
Owner

This will be available in v1.31.0.

If you'd like to use it before the next release, you can download v1.31.0-beta.3, and install it following the instructions provided here.

homsai pushed a commit to homsai/vscode-git-graph that referenced this issue Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement An improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants