-
-
Notifications
You must be signed in to change notification settings - Fork 267
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 custom tag message #631
Add custom tag message #631
Conversation
I like
This should have been solved. Let me rebase your branch and see how it works. |
Hi @LuisHenri , |
Codecov ReportAttention:
📢 Thoughts on this report? Let us know!. |
Hey @Lee-W, |
I would really love to see this feature :) |
@Lee-W is something else needed still? |
Hi @LuisHenri , sorry for the late review; I'm out of bandwidth these days. But I planned to take a look at a few PRs tomorrow. If you can rebase this PR and mention me, I'll take a look tomorrow. Thanks! |
@Lee-W Sorry for the delay. I'm done. |
Hi @LuisHenri , instead of merging main branch, we prefer rebasing. You can do so through |
3716b1b
to
c064be5
Compare
@Lee-W Thanks for the advice! What about now? :) |
9d88ad3
to
dead382
Compare
@LuisHenri perfect! I'll try to take a deeper look this weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @LuisHenri , thanks for your contribution. the change looks good to me!
@woile I'm planning on merging this one these days. Let me know if you want to take a deeper look
Is it possible to add a message to a light tag? If not, should we throw an error to inform the user? |
@woile According to https://git-scm.com/book/en/v2/Git-Basics-Tagging, it seems we're not able to do that for a light tag |
_opt = "" | ||
if annotated: | ||
_opt = f"-a {tag} -m" | ||
if signed: | ||
_opt = f"-s {tag} -m" | ||
c = cmd.run(f"git tag {_opt} {tag}") | ||
|
||
c = cmd.run(f'git tag {_opt} "{tag if _opt == "" or msg is None else msg}"') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@woile do you mean we should add a warning here to let the users know if they're using this feature, they're actually creating annotated tag?
To create a lightweight tag, don’t supply any of the -a, -s, or -m options, just provide a tag name:
https://git-scm.com/book/en/v2/Git-Basics-Tagging
not sure whether my understanding is correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, maybe a comment there explaining that. I didn't know that if you provide a message it automatically becomes an annotated tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@woile I just added the comment and resolved the conflict. Could you please take a look? I think we're pretty close to merge this one :)
cc @noirbizarre
Co-authored-by: Wei Lee <[email protected]>
23244b8
to
976c2b2
Compare
@Lee-W |
Something like the following works git commit -m "first line
second line
third line" |
@woile @noirbizarre I'm planning on merging this one today. Please let me know if you want to take a look. Thanks! |
Description
According to #558, I implemented a custom tag message for annotated tags.
Right now, the annotated tag is given as "tag_name" with its message as "tag_name" as well. It might be nice to have custom tag messages, for example, to add the features added on that tag.
The idea is a new argument to bump with the tag_message,
Checklist
./scripts/format
and./scripts/test
locally to ensure this change passes linter check and testExpected behavior
Running the following commands will create an annotated tag with "a message" as the message of the tag.
Steps to Test This Pull Request
cz bump -atm "a message"
git tag -l --format='%(contents:subject)' <the-created-tag-name>
'a message'
Additional context
Based on Issue #558
Open questions:
--annotated-tag-message
or as--annotated-tag-msg
to keep it short?