-
-
Couldn't load subscription status.
- Fork 302
Add custom tag message #631
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
Changes from all commits
29997f6
ffcf0ff
d7dc8b4
22304f0
8568427
5b7991b
7037766
b981a29
2b040cb
72455ba
1278f63
e6b6c55
29d12d1
315493f
976c2b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,13 +82,19 @@ def from_line(cls, line: str, inner_delimiter: str) -> GitTag: | |
| return cls(name=name, rev=obj, date=date) | ||
|
|
||
|
|
||
| def tag(tag: str, annotated: bool = False, signed: bool = False) -> cmd.Command: | ||
| def tag( | ||
| tag: str, annotated: bool = False, signed: bool = False, msg: str | None = None | ||
| ) -> cmd.Command: | ||
| _opt = "" | ||
| if annotated: | ||
| _opt = f"-a {tag} -m" | ||
| if signed: | ||
| _opt = f"-s {tag} -m" | ||
| c = cmd.run(f"git tag {_opt} {tag}") | ||
|
|
||
| # according to https://git-scm.com/book/en/v2/Git-Basics-Tagging, | ||
| # we're not able to create lightweight tag with message. | ||
| # by adding message, we make it a annotated tags | ||
| 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 commentThe 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?
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 commentThe 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 commentThe 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 |
||
| return c | ||
|
|
||
|
|
||
|
|
@@ -200,6 +206,13 @@ def get_latest_tag_name() -> str | None: | |
| return c.out.strip() | ||
|
|
||
|
|
||
| def get_tag_message(tag: str) -> str | None: | ||
| c = cmd.run(f"git tag -l --format='%(contents:subject)' {tag}") | ||
| if c.err: | ||
| return None | ||
| return c.out.strip() | ||
|
|
||
|
|
||
| def get_tag_names() -> list[str | None]: | ||
| c = cmd.run("git tag --list") | ||
| if c.err: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.