Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 345
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
29997f6ffcf0ffd7dc8b422304f085684275b7991b7037766b981a292b040cb72455ba1278f63e6b6c5529d12d1315493f976c2b2File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
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}"') | ||
Member 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 Member 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. Member 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.