-
Notifications
You must be signed in to change notification settings - Fork 152
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
Git tags - support for multiple versions on same commit #79
Comments
Hm, one other (perhaps more common) way this might happen is if a release candidate gets promoted to the final release without additional changes, so you'd have "v1.0rc1" and "v1.0" tags on the same commit. (This is probably the ideal outcome in any process that involves "release candidates": making no changes between your last candidate and the final release). In that case, however, the more-final less-candidate-ish tag is shorter, so "shortest tag wins" still works. How do you update the package dependencies without changing the source code at all? I guess the dependencies are being tracked externally somehow? I'm thinking we could include a list of all tags in the The built-in sort would ideally use the PEP440 version-sort logic (so it'd pick 1.0.1 over 1.0.0), but I don't want to have to import an external library to do the sort, so I'm not sure of the best way to bring that code into versioneer.py . Maybe it'd be good enough to:
That'd choose 1.0.1 over 1.0.0, but also 1.2.13 over 1.10.2 . We could assume dotted-decimal and |
"Updating dependencies without updating code": We may have a 1st party dependency pinned at only the major (library>=1,<2). We trust our internal changes to not make breaking changes (and don't want to have to update minor versions each time a minor library changes). Then we'll rebuild our application (run our tests, etc.) with that library and "release" that as a new version. Yes, your RC example is probably a better example of this use case. I notice you use setuptools in some places, is this a dependency you can rely on being there? setuptools' parse_version is PEP 440 compliant and looks to do what we need: https://pythonhosted.org/setuptools/pkg_resources.html#parsing-utilities Edit: I see you depend on "setuptools" or "distutils", so I think it's possible to use setuptools' parse_version and (failing that) distutils' StrictVersion (http://nullege.com/codes/search/distutils.version.StrictVersion) |
Ah, now I get it: the compiled executable is your versioned artifact, rather than your source tree. Compiling the same source tree at two different times (between which a new upstream dependency was released) results in two different executables, and you want those executables to have different version strings. Yeah, I guess in all the projects I've managed, we do that by having the CLI Anyways, yeah, we could try to import |
Tagging with annotated tags not only adds the timestamp and committer account to this tag (and a message that probably nobody cares about), but also allows Git to pick the more recent tag, i.e. the one added later in time, when running |
|
You may be referring to lightweight tags - that's why I explicitly talked about annotated tags:
Following your logic, the last line should have returned "a" as the tag. It returns "z" because that is the last tag created on the commit, ordered by timestamps of the tags.
|
OK, thanks, this is actually a great workaround for our current issues and a great practice anyway... |
|
For my purposes I added a block of code after
|
I think that the current mechanism for getting tags (improved in #77) doesn't pick the biggest version if you tag the same commit multiple times for the same application but for different versions.
Basically when I bump a version number for my application without doing a commit (not that common but does happen if we update a package's dependencies) the older tag is getting picked up.
Probably easiest to illustrate just using git and the current "git describe" command:
Here 1.0.0 is getting taken over 1.0.1, clearly I'd like to have 1.0.1 taken over it.
From initial googling there seems to be a way to get the current tags for a commit. I suppose you could take these all in, parse them and pick the biggest? But I guess this doesn't give you the nice things that describe does (like dirty and commits ahead).
The text was updated successfully, but these errors were encountered: