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

Creating annotated tag without message, how? #494

Closed
Igorgro opened this issue Apr 6, 2021 · 2 comments
Closed

Creating annotated tag without message, how? #494

Igorgro opened this issue Apr 6, 2021 · 2 comments
Assignees
Labels
question Do you have a question about Git Graph?
Projects
Milestone

Comments

@Igorgro
Copy link

Igorgro commented Apr 6, 2021

Using this extension it is possible to create an annotated tag without message by not filling message field. However i can't reproduce this using git command, it just fails with 'fatal' message. I've investigated and found in "Output" tab that extension runs command git tag -a <tag name> -m <commit hash>, but this command also doesn't work. So, how this is implemented and how it can be done without this extension?

@Igorgro Igorgro added the question Do you have a question about Git Graph? label Apr 6, 2021
@mhutchie
Copy link
Owner

mhutchie commented Apr 6, 2021

Hi @Igorgro,

It depends on what terminal you use, but running git tag -a <tag name> -m "" <commit hash> in the Windows Command Prompt will produce an annotated tag without a message. I expect all other shells will have a way to specify an empty string argument.

Internally, the extension spawns a child process to execute each Git command, which accepts all of the command arguments as an array of strings (e.g. ["tag", "-a", "<tag name>", "-m", "<message>", "<commit hash>"]) - which nicely handles empty strings and avoids escaping issues. The Git Graph Output Channel displays the executed commands by simply joining all these arguments with a space separator, hence the current behaviour with an empty message, and the double space between -m & <commit hash>.

I'll adjust the Output Channel to explicitly display empty string arguments as "" in the next release, to make it clearer.

@mhutchie mhutchie closed this as completed Apr 6, 2021
@mhutchie mhutchie added this to To Do in Git Graph via automation Apr 12, 2021
@mhutchie mhutchie added this to the v1.31.0 milestone Apr 12, 2021
@mhutchie mhutchie moved this from To Do to In Progress in Git Graph Apr 12, 2021
@mhutchie
Copy link
Owner

I made several improvements to the logging of Git commands to the Output Channel, including to explicitly display empty string arguments as "".

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.0, and install it following the instructions provided here.

@mhutchie mhutchie moved this from In Progress to Ready For Release in Git Graph Apr 12, 2021
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
question Do you have a question about Git Graph?
Projects
Git Graph
Ready For Release
Development

No branches or pull requests

2 participants