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

Display a warning before pushing a tag that's not on a commit on the same remote(s) #507

Closed
rbalet opened this issue May 9, 2021 · 3 comments
Assignees
Labels
improvement An improvement to existing functionality
Projects
Milestone

Comments

@rbalet
Copy link

rbalet commented May 9, 2021

Describe the Bug
It's may be a feature request
I'm able to create a tag and push it to the origin without having pushed the latest changes done on the branch.

Steps to Reproduce

  1. Merge a branch (develop) into another (master)
  2. Add Tag... -> push the tag
  3. It will be pushed
  4. Analyze on gitlab, (maybe the same on github) everything seems to be working, also have the name of the latest change, let say Merge commit '355c12592f84670268d6b0c71c5c613eb0d9ffe9' but since this one wasn't pushed and only exists locally, the tag will exists in the wrong commit (the former one that was pushed)

Expected Behaviour
Warn if you would really push a tag in an not pushed branch

@rbalet rbalet added the bug Something isn't working label May 9, 2021
@mhutchie
Copy link
Owner

mhutchie commented May 9, 2021

Hi @rbalet,

I just tested this on GitHub to check it's behaviour compared to GitLab. On a GitHub Remote, it pushes the tag and all necessary commits to GitHub, so the tag ends up being on the correct commit. It seems like it might just be GitLab that's doing an unexpected behaviour.

Git Graph runs the necessary Git commands, based on what the user has requested in the user interface. In this case, it is correctly running git push <remote> <tag-name>. If the Git command was to exit with a non-zero exit code (i.e. Git threw an error), the error is also shown to the user in an error dialog. In your situation, Git is not throwing an error from GitLab, so no error dialog is display to the user. If you ran the same Git command in a terminal, the exact same behaviour would occur.

I definitely agree that it would be worthwhile giving users a simple warning prompt if they're trying to push a tag that's not on a commit on the same remote(s). I've found a suitable Git command that can be used to perform this check, as the required information isn't always available in the Git Graph View. I'll implement this in the upcoming release.

@mhutchie mhutchie added improvement An improvement to existing functionality and removed bug Something isn't working labels May 9, 2021
@mhutchie mhutchie added this to To Do in Git Graph via automation May 9, 2021
@mhutchie mhutchie added this to the v1.31.0 milestone May 9, 2021
@mhutchie mhutchie changed the title Able to push tag on not pushed commit Display a warning before pushing a tag that's not on a commit on the same remote(s) May 9, 2021
@rbalet
Copy link
Author

rbalet commented May 10, 2021

@mhutchie Like, always, thx a lot. I'll open an issue for the gitlab team

@mhutchie mhutchie moved this from To Do to In Progress in Git Graph May 16, 2021
mhutchie added a commit that referenced this issue May 30, 2021
…t isn't on any known branch on the remote(s) the tag is being pushed to.
@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.2, and install it following the instructions provided here.

Git Graph automation moved this from In Progress to Ready For Release May 30, 2021
homsai pushed a commit to homsai/vscode-git-graph that referenced this issue Sep 7, 2022
…mmit that isn't on any known branch on the remote(s) the tag is being pushed to.
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
Git Graph
Ready For Release
Development

No branches or pull requests

2 participants