-
Notifications
You must be signed in to change notification settings - Fork 708
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
--tag-callback only executes on annotated tags, not lightweight tags #591
Comments
For now, to be perfectly honest, I'm just hard-code-changing the content of my installed @staticmethod
def _do_tag_rename(rename_str, tagname):
if not tagname.startswith(b'refs/tags/'):
return tagname
tagname = tagname.removeprefix(b'refs/tags/').decode()
return ("refs/tags/" + rename_str.decode().format(tagname=tagname)).encode() |
Why not use --refname-callback? e.g.
|
I'll try this out. I assume this will work for renaming the lightweight tags, but in general it's still a bit unexpected that the I'm okay with this as a solution as I assume it gets me to where I need, but I think the docs should be updated to reflect that due to compatibility purposes (or whatever), |
Sorry for the delay.
The docs actually do already cover this:
But I see how the distinction between a tag reference and a tag object is a subtle point that will probably be missed by many users. Most aren't that familiar with git's object model of blobs, trees, commits, and tags, and how tag objects include a tagger and tag message and a pointer to the commit in question. Lightweight tags do not point at tag objects, they instead just point straight to a commit object, and as such, we do not have a tagger and tag message to populate the tag object with. Since the tag callback is supposed to operate on a tag object, there simply isn't anything for the tag callback to be called with or on when dealing with a lightweight tag; --tag-callback is all about operating on tag objects so lightweight tags are naturally excluded. Anyway, I updated the docs. They now have a few extra sentences to make this clear:
|
Context on annotated vs lightweight tags.
So, the fuller story here goes:
v
to indicate a release. For example,v1.2.3
. Sometimesv1.2.3.4
depending on the use case. Can have as many parts as one wants. Can also have a suffix, as well as a numerical one. E.g.v.1.2.3-suffix
is less thanv1.2.4-suffix
and both of these are incommensurable with¯\_(ツ)_/¯
--tag-rename
since that only does prefixes (maybe I should do another feature request that expands--tag-rename
to a full callback, so one can just f-string rather than be limited to prefixes and suffixes)?--tag-callback
because it only acts upon annotated tags.--commit-callback
if it exists, and add that information to the commit, in the case of lightweight and/or annotated tags (if annotated, would be nice to be able to access more than just the tag-ref-name.The text was updated successfully, but these errors were encountered: